cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
wiredupjax
Level: Powered On

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
Community Support Team
Community Support Team

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

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.
wiredupjax
Level: Powered On

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

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

Community Support Team
Community Support Team

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

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.
wiredupjax
Level: Powered On

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

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
thirdimage

Power Automate Community User Group Member Badge

Fill out a quick form to claim your user group badge now!

firstImage

Incoming: New and improved badges!

We've given our badges an overhaul and also added some brand new ones!

fifthimage

Microsoft Learn

Learn how to build the business apps that you need.

sixthImage

Power Platform World Tour

Find out where you can attend!

seventhimage

Webinars & Video Gallery

Watch & learn from the Power Automate Community Video Gallery!

Top Kudoed Authors (Last 30 Days)
Users online (5,205)