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

Apply To Each action Expression Failure

Hello, 

I am creating a flow to be used within our Onboarding Process in SharePoint.  When a new hire is added to a list in the SharePoint site, it creates a series of events to be added to the Outlook Calendar on the new employee's start date.  I need to add a condition to my flow, if the new hire's department is equal to 'Production' then they get one set of events, and if their department is anything else they get a different set of events.  I am getting the below error on the Apply to Each function.  In my limited experience, I have always used the ID from the previous function in this field (in this case, When item is created in SharePoint), however it is returning the Expression Evaluation Failure, pictured below.  I have also tried using the Employee Id which is our unique identifier.  I appreciate any thoughts you may have. Thank you. 

 

Capture 1.png

 

Capture 2.png

 

1 ACCEPTED SOLUTION

Accepted Solutions
annajhaveri
Super User
Super User

Hello,

 

Why are you using Apply to Each in your flow, apply to each is used when you want to loop through a collection. Here you are looping through ID, ID is a number value and its not a collection, that is why it is resulting to error. You can remove move the Condition action outside the apply to each and remove the apply to each if you dont need to loop through the collection as from the screenshot i dont see any collection defined in your Flow.

Regards,
Anna Jhaveri

If I have answered your question, please mark the post as Solved to help other users to identify the correct answer
If you like my response, please give it a Thumbs Up.

View solution in original post

1 REPLY 1
annajhaveri
Super User
Super User

Hello,

 

Why are you using Apply to Each in your flow, apply to each is used when you want to loop through a collection. Here you are looping through ID, ID is a number value and its not a collection, that is why it is resulting to error. You can remove move the Condition action outside the apply to each and remove the apply to each if you dont need to loop through the collection as from the screenshot i dont see any collection defined in your Flow.

Regards,
Anna Jhaveri

If I have answered your question, please mark the post as Solved to help other users to identify the correct answer
If you like my response, please give it a Thumbs Up.

View solution in original post

Helpful resources

Announcements
MPA_User Group Leader_768x460.jpg

Manage your user group events

Check out the News & Announcements to learn more.

V3_PVA CAmpaign Carousel.png

Community Challenge - Giveaways!

Participate in the Power Virtual Agents Community Challenge

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.

R2 (Green) 768 x 460px.png

Microsoft Dynamics 365 & Power Platform User Professionals

DynamicsCon is a FREE, 4 half-day virtual learning experience for 11,000+ Microsoft Business Application users and professionals.

Top Solution Authors
Users online (1,396)