Problem: The execution of template action 'Apply_to_each_10' failed: the result of the evaluation of 'foreach' expression ' @{createArray('1','2','3','4','5','6','7','8')}' is of type 'String'. The result must be a valid array.
I have tried multiple solutions but the flow still trigger error.
Please help.
Thank you.
Regards,
Jo
Your createArray expression should work fine in the apply to each. What I suspect is that you have a character in the field (such as a space) which is not visible.
Expression should just be:
createArray('1','2','3','4','5','6','7','8')
Or perhaps this would be simpler:
range(1,8)
Then you should be set. It is the presence of extra characters which is changing your valid array into a string.
Blog: tachytelic.net
YouTube: https://www.youtube.com/c/PaulieM/videos
If I answered your question, please accept it as a solution 😘
Sorry it seems you just do not understand what is the array. The "Outcome" is a string.
What are you trying to achieve?
I have tried initialize the array as variable in earlier flow. But the similar error has been trigger.
Beginning of flow: Initialize an array variable:
Middle of flow: The output from previous flow: I put the initialized array variable
Thank you.
Do not create an array in "foreach". Initialize the array as a variable earlier.
Michael E. Gernaey
497
Super User 2025 Season 2
David_MA
436
Super User 2025 Season 2
Riyaz_riz11
244
Super User 2025 Season 2