cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
psadd2
Regular Visitor

A SharePoint List Filtered Array and Sending emails

I have a flow which filters a SharePoint List down to a required subset, using OData Filter and then Filter Array. If I end with a Compose Length(Item) I get the number of items I estimated. Great so far.

 

I now need to take that subset and look at field 'Status'....if it's 'Due Now' I want to send and email...if it's 'Overdue' I want to send a different email. So now I want to add a Condition that says if Status is 'Due Now' take the YES branch, if not take the NO branch...but once I have a Filter Array all I can choose in the condition is ITEM or BODY....I can't see Status unless I pull it from GET ITEMS stage which is pre-filtering and therefore not what I want.

 

psadd2_1-1631712548124.png


If I can understand how to reference the correct field from within the Filter Array this will let me control the Condition...and also add the relevant 'dynamic' information to the body of the emails and the deep linking that I need to do.

 

Please help me from throwing my PC out of the window!

 

Thanks

 

Paul

1 ACCEPTED SOLUTION

Accepted Solutions
Paulie78
Super User
Super User

You can use item()['fieldname']

View solution in original post

5 REPLIES 5
Paulie78
Super User
Super User

I would take a slightly different approach, instead of having a condition inside of your loop. Modify your original filter so that it filters for Update Status = Good AND Status = Due now. Then add another filter action, again on the results of the original get items which is Update Status = Good and Status <> Good.

 

You will then have two filtered arrays, containing only the data you are interested for a particular action and you wont need to have a condition within your loop. Does that make sense? 

Thanks for the prompt reply....it kind of makes sense.

The reason I don't have the Status filtered in the OData part is because it's a Calculated field in my List and you can't use those in the OData filter....so I filter what I can and then proceed to filter the results further. Actually I want to ignore the GOOD...don't need to email them at all...it's the DUE NOW and OVERDUE that need the reminder emails.
I just can't see how I can reference any specific field when the only thing I get back from a Filter Array is ITEM and BODY so even splitting the filters as you suggest still leaves me with the same issue....I think.

 

Thanks

Paulie78
Super User
Super User

You can use item()['fieldname']

View solution in original post

psadd2
Regular Visitor

ah....let me give that a whirl......thanks

Hi Paulie78,
Thanks for your interest and help previous...but I'm still stuck. I've gone down the route of branching the flow, as you can see in the image. One side the Filter Array on 'Due Now' the other 'Overdue'. If I stick in a Compose Length Body after the filters I get the correct number back. 9 Due Now and 1 Overdue. What I need to do is to send and email to each of the 9 Due Now and the 1 Overdue but I can't seem to make the 'Apply to Each' control work. At the moment I'm sending myself all the emails...if I can get that working then I really need to tailor each email to the people/projects in each item.

psadd2_0-1631789911083.png

Grateful for any help you can give.

 

Thanks

 

Paul

Helpful resources

Announcements
UG GA Amplification 768x460.png

Launching new user group features

Learn how to create your own user groups today!

Community Connections 768x460.jpg

Community & How To Videos

Check out the new Power Platform Community Connections gallery!

M365 768x460.jpg

Microsoft 365 Collaboration Conference | December 7–9, 2021

Join us, in-person, December 7–9 in Las Vegas, for the largest gathering of the Microsoft community in the world.

Top Kudoed Authors
Users online (2,803)