cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
TonjeWaa
Advocate I
Advocate I

For each error: ExpressionEvaluationFailed

I have a SP list with a number column. In my flow, I'm have a loop that gets all the elements with todays day and then increment an Integer variable with the numbers from the number column. When I try to run it, I get the errormessage 

 

"ExpressionEvaluationFailed. The execution of template action 'Dagens_bestillinger' failed:
the result of the evaluation of 'foreach' expression '@outputs('Get_item')?['body/ID']' is of type 'Integer'.
The result must be a valid array."

 

Why must the result be a valid array and how can I make that happen? It's a number I want to get out of it. 

 

TonjeWaa_0-1599464298435.pngTonjeWaa_1-1599464314189.png

 

1 ACCEPTED SOLUTION

Accepted Solutions
TonjeWaa
Advocate I
Advocate I

I found out the problem. I could not have a nested for each, but when I removed the outer loop, it worked like a charm 😃

View solution in original post

5 REPLIES 5
fchopo
Super User II
Super User II

Hello @TonjeWaa 

It seems that the ID column is a multi-value one. Am I right? Could the ID column have multiple values? If so, you should select, for example, the first element, and add it to the variable "dagens skinke og ost".

To solve it:

1) remove the "for each element" in the yes condition result.

2) In the Increment variable action, you should write an expression like, so you get the first element of the ID field.

item()?['ID'][0]

 

Hope it helps!

Ferran

 

Did I answer your question? Please consider to mark my post as a solution to help others.
Proud to be a Flownaut!

Thanks for your answer @fchopo. It is multi-value, but I want each of the items to add their columnvalue to the variable, not just the first. 

 

Here is my senario: I have people ordering food through a MS Form for a specific date, it then goes in to a list in SP. Here it is 4 number columns that hold how many items of each food the person wants and ha datecolumn. Each day a flow triggers and goes through alle the columns and find the once from today. Alle this works fine. But then it should go througt the items for today and add the sum of each of the four columns together. So I get 2 salads, 4 sandwiches and 2 apples for example. 

Hello @TonjeWaa 

As I understand, you need to sum 4 columns... So you could use an expression like this in the "increment variable" action:

sum(column1,sum(column2,sum(column3,column4)))

Hope it helps!

Ferran

Did I answer your question? Please consider to mark my post as a solution to help others.
Proud to be a Flownaut!

I don't want to sum the 4 columns, I want to sum alle the items in the list for each column separetly. So I need the for each item to get all the items

 

//tonje

TonjeWaa
Advocate I
Advocate I

I found out the problem. I could not have a nested for each, but when I removed the outer loop, it worked like a charm 😃

View solution in original post

Helpful resources

Announcements
MPA User Group

Welcome to the User Group Public Preview

Check out new user group experience and if you are a leader please create your group

MBAS on Demand

Microsoft Business Applications Summit sessions

On-demand access to all the great content presented by the product teams and community members! #MSBizAppsSummit #CommunityRocks

MBAS Attendee Badge

Claim Your Badge & Digital Swag!

Check out how to claim yours today!

secondImage

Are Your Ready?

Test your skills now with the Cloud Skill Challenge.

Top Solution Authors
Users online (51,756)