cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
JamesM
Level 8

Flow with same logic as previous flow fails with - the result of the evaluation of 'foreach'

I have a flow which stores the JSON results of a web API GET into an object then loops through a For Each Apply using a value from within the object. It uses that value to call another web API. Here is its structure: 

 

2018-10-31 13_15_33-Edit your flow _ Microsoft Flow.png

 

I copied this same logic for another flow, here is the structure (interestingly the color coding of the values is different? Even though I have used the same expression text, it shows 'fx' instead of the item and variable icons. 

 

2018-10-31 13_15_33-Edit your flow _ Microsoft Flow1.png

 

This flow fails with:

 

ExpressionEvaluationFailed. The execution of template action 'loopAudits' failed: the result of the evaluation of 'foreach' expression '@variables('iAuditorAudits')' is of type 'Object'. The result must be a valid array.

 

This doesn't make sense to me. The previous flow also uses an object of the same name with the same structure? Can anyone assist? 

 

1 ACCEPTED SOLUTION

Accepted Solutions
JamesM
Level 8

Re: Flow with same logic as previous flow fails with - the result of the evaluation of 'foreach'

Never mind, this is a bug in the designer. 

 

When I hover over my foreach condition in the designer of my first flow, the tooltip shows: 

 

variables('iAuditorAudits')

 

(and if I click on it, it doesn't show the that value in the dynamic properties dialog, so the tooltip hover was all I had to go off)

 

However if I export the JSON, I can see it is in fact: 

 

"foreach":"@variables('iAuditorAudits')['audits']"

Changing this in my new flow fixed the issue. A clear designer bug I think. 

1 REPLY 1
JamesM
Level 8

Re: Flow with same logic as previous flow fails with - the result of the evaluation of 'foreach'

Never mind, this is a bug in the designer. 

 

When I hover over my foreach condition in the designer of my first flow, the tooltip shows: 

 

variables('iAuditorAudits')

 

(and if I click on it, it doesn't show the that value in the dynamic properties dialog, so the tooltip hover was all I had to go off)

 

However if I export the JSON, I can see it is in fact: 

 

"foreach":"@variables('iAuditorAudits')['audits']"

Changing this in my new flow fixed the issue. A clear designer bug I think. 

Helpful resources

Announcements
firstImage

Microsoft Business Applications Virtual Launch Event

Watch the event on demand for an in-depth look at the new innovations across Dynamics 365 and the Microsoft Power Platform.

firstImage

Watch Sessions On Demand!

Continue your learning in our online communities.

Power Platform 2019 Release Wave 2 Plan

Power Platform 2019 Release Wave 2 Plan

Features releasing from October 2019 through March 2020.

thirdimage

Flow Community User Group Member Badge

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

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 Flow Community Video Gallery!

Top Kudoed Authors
Users Online
Currently online: 358 members 4,972 guests
Please welcome our newest community members: