cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
Helper V
Helper V

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
Highlighted
Helper V
Helper V

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
Highlighted
Helper V
Helper V

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
firstImage

Super User Program Update

Three Super User rank tiers have been launched!

firstImage

Power Platform 2020 release wave 2 plan

Features releasing from October 2020 through March 2021

firstImage

New & Improved Power Automate Community Cookbook

We've updated and improved the layout and uploading format of the Power Automate Cookbook!

thirdimage

Power Automate Community User Group Member Badge

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

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