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. 

View solution in original post

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. 

View solution in original post

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,111)