cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
gautmish
Helper III
Helper III

microsoft flow get all items with distinct Assigned to (User and group) filed

Hi

 

I am creating a flow to get all the item assined to a single user and send an email to that user with all the item detail .

 

I dont want to send separate email for each task .

 

Could you please help me with any option . 

 

Thanks

Gautmish

131 REPLIES 131

@ckotekar The skip command in your "Compose 2" action needs to be entered as an "Expression" and not a string.  When it is entered correctly it should look like the compose action below.Capture.JPG

@-Garrett-  Thanks for the quick response.

 

Unfortunately, I don't have the 'Dynamic content/Expression' view (same is visible in the snapshot shared earlier). It was visible earlier (at least 7-8 months ago) and had used it too, and I likely would have disabled it unintentionally. Even after trying to get this activated, I failed to figure out. Since it is of enabling some option, could you/anyone help me to get it back? Routing me to a Help page would also suffice.

 

Thanks in advance!

@-Garrett- ... that's a great tip. It helped 😍.

 

This is not intuitive nor I ever imagined that Zooming the page is the solution. Not sure if its a Bug or as per the design, but for sure I see an opportunity for enhancement!.

 

 

@-Garrett- , I have a follow-up question. 

 

The Flow is working perfectly fine as suggested in the thread. 

 

The flow I am creating is to send reminders to the relevant stakeholders for action from them. Once the activity is complete, I wouldn't want any email to be triggered for that task. To achieve that, I see 2 options,

  1. Delete the person information from the field. No mail if the column entry is empty.
  2. Use another field that indicates the status (Open/In-progress, Closed). No mail if the status is closed.

I tried option 1 as an easy way but I have an error from the 'Append Array' block as it returns NULL. Even adding a filter in the 'Get item' dint help much.

 

Could you please suggest me on this. Since I'm a novice with the Flows, looking forward to some help with the best option along with the hint on expression or block to be used.

 

Thanks in advance!

 

Hello @ckotekar ,

 

I would use option 2 as you suggested, you can add a filter to your get items task to only grab the items you want to send an email about. You may be able to do option 1 by adding a conditional task in the flow that if the email is null it won't do anything

 

Thanks,

Zach

Hello @ZachRoberts 

 

I inserted a column 'status' and have incorporated 'Condition' inside 'Apply to all' block. This works fine for 'Append to array variable'. But looks like I'm missing something on 'Do until' block to filter out entries with status 'Done' (Filter Arra 2 block in the snapshot). Will need some help to set the right filter. Again, I am not sure if Filter is the right approach. 

 

Could I get some help here?

MSFlowError_2.png

 

Thanks in advance!

@ckotekar I am by no means a Power Automate "Expert" but my personal understanding is that it is best practice, and will improve performance on large list, to use OData filter inside of the "Get Items" Action.  Please reference the below link for information on why this is.

 

https://sharepains.com/2018/11/12/sharepoint-get-items-odata-filter-query/

@-Garrett-  This was easiest way to get through while I was making it complicated with conditional block ...😏.

I remember trying ODATA field in the past but missed using the right syntax. Succeeded this time.

 

Thanks a ton...!

This worked great however I do have a question. I am trying to include output from a choice column type in the html and it keeps outputting the array like so instead of the value:

 

[{"@odata.type":"#Microsoft.Azure.Connectors.SharePoint.SPListExpandedReference","Id":10,"Value":"Drew"},{"@odata.type":"#Microsoft.Azure.Connectors.SharePoint.SPListExpandedReference","Id":11,"Value":"Evan"}]


Here is what I have in my scenario from your example:

Selection_006.png

So this @{item()?['Whose_x0020_Court_x0020_is_x0020']} is outputting the array instead of value.

If I put this code in it gets only the first value correctly:

Selection_007.png

So @{item()?['Whose_x0020_Court_x0020_is_x0020'][0]?['Value']} will output the name Drew. If I put @{item()?['Whose_x0020_Court_x0020_is_x0020'][1]?['Value']} it will output the second name. My understanding is I can't code it like this because if a column has one name and I code it for two then the flow will break.


Here is a snippet of the output from the filter array:

Selection_008.png

End result I am trying to get the column in the email to say Drew, Evan. Hope this makes sense. I am a bit new to this and have a hunch I need to apply all to this value somehow however I am stumped. Thanks for any hints you can give to help.

Hi,  Thank you for this solution.  I am having real trouble with the skip function.  It is sending the initial email to the first name on the union list and then skipping to the second but then gets stuck and sends the same email depending on the number of rows in the list.  I have found that 

skip(variables('Staff Name'),1) produces the full list of names unlike the union so I change the variable inn the skip function to the union compose output.  It still gets stuck o the send on continues to send out multiple emails with the same info.
 
Would you mind assisting on this question please.
 
Thank you
Clint
Powerplatform01
Post Patron
Post Patron

@gautmish 

You can take reference from this video.Also request you to please subscribe this PowerAutomate channel

https://youtu.be/HFghBAYX-oQ

Helpful resources

Announcements
MPA_User Group Leader_768x460.jpg

Manage your user group events

Check out the News & Announcements to learn more.

Community Connections 768x460.jpg

Community & How To Videos

Check out the new Power Platform Community Connections gallery!

Welcome Super Users.jpg

Super User Season 2

Congratulations, the new Super User Season 2 for 2021 has started!

Carousel 2021 Release Wave 2 Plan 768x460.jpg

2021 Release Wave 2 Plan

Power Platform release plan for the 2021 release wave 2 describes all new features releasing from October 2021 through March 2022.

Users online (1,054)