cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
Resolver I
Resolver I

Filter array does not pass variable a secondary "apply to each"

FLOW: Announce to the entire organization an employee's work anniversary.

 

It's about 90% complete; I can accurately filter and send an email to the individual but I need to send it to the entire organization using the same employee sharepoint list email field.

 

What I need to do is pass the individual's work anniversary information (name, years of service) to a secondary "apply to each" loop which will send the announcement to each person.

 

PROBLEM: I used an express item()?['xxxxxxxxx'] using fields from the filter array in the secondary "apply to each" loop; however, the flow is removing the "item()..." and putting the "get items" info instead.  

 

Here are some screenshots of the flow:

 

screen1.pngscreen2.png

4 REPLIES 4
Highlighted
Community Support
Community Support

Hi @wiredupjax,

 

The cause of your issue is that the secondary "apply to each" loop uses the value of the Get items output. For example, the Process_Status..  you used in the condition and First Name used in the email.

 

I think that to achieve your requirement, you don't have to use the secondary "apply to each" loop.

 

You could use items('Apply_to_each')?['Column'] directly to get the values and filter array. 

 

I have made a test on my side, for the test, I just used Status for the first filter.

 

46.PNG

 

Expression reference:

items('Apply_to_each')?['Process_x0020_Status']
items('Apply_to_each')?['First_x0020_Name']

45.PNG

 

The flow works successfully as below:

 

47.PNG

 

Please feel free reply if you need more help.

 

Best Regards,

Barry

Community Support Team _ Barry
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Highlighted

Hi Barry,

 

Yes, this works for selecting a group of individuals via the filter array - the individuals who have been identified as having a work anniversary...

 

However, i want to send the message to the entire organization which is why i nested the Apply-to loop.

 

Thus, I identified 2 employees with a work anniversary, then sent a separate email to EVERY member of the organization.

 

Does that make sense?
Thanks, Jason

Highlighted

Hi @wiredupjax,

 

Do you mean that you have employee's email field in the SP list, like this?

 

17.PNG

 

Maybe you could do like this, move Apply to each 2 to IF YES, don't know if this will meet your requirements.

 

18.PNG

 

Please take a try and feel free reply if you still have issue.

 

Best Regards,

Barry

Community Support Team _ Barry
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Highlighted

I don't think this is correct... I will restate the requirements:

 

1. Identify any and all employees who have a work anniversary using the hire_date field

2. Send an email to ALL employees in the list

Helpful resources

Announcements
Community Conference

Power Platform Community Conference

Check out the on demand sessions that are available now!

Power Platform ISV Studio

Power Platform ISV Studio

ISV Studio is designed to become the go-to Power Platform destination for ISV’s to monitor & manage published applications.

Top Solution Authors
Top Kudoed Authors
Users online (8,850)