Announcements
I have a form that asks how many loads do you want to request, would there be a way in this example to add 4 rows of data with the same information on all 4? I get the following error when trying to run.
THanks,
Hi @Myatt42
Just wrap your answer in the json() expression and it will be treated as an array, rather than a string.
Please consider accepting my answer as a solution if it helps to solve your problem.CheersDamienPlease take a look and subscribe to my YouTube Channel for more Power Platform ideas and concepts, or take a look at my website. Thanks
Sorry where would I put that?
In the select item from previous step. As seen here https://youtu.be/8_iBkw3bH8A?t=300.
Damien
The execution of template action 'Apply_to_each_2' failed: the result of the evaluation of 'foreach' expression '@json(outputs('Get_response_details')?['body/r6c8be98b16774ea0a80dee1b3e14baaf'])' is of type 'Integer'. The result must be a valid array.
Im only getting them to enter 1 number... anywhere from 1 to 20.
I’ve misunderstood. I thought you hid the array of multiple answers as there are 4, but you have an integer 4 and want 4 rows as a result. So, what you want is range(1,answer) as the input to the apply to each. It will loop 4 times and repeat the add row action. Apologies.
No worries, I apologize for all the questions.
I now get this message
Unable to process template language expressions for action 'Apply_to_each' at line '0' and column '0': 'The template language function 'range' expects two integer parameters: an inclisive start index of the range as the first parameter and a count of integers to return as the second parameter. The function was invoked with '1' parameter(s). Please see https://aka.ms/logicexpressions#range for usage details.'.
This is what you are looking for:
The error indicates that your range only has one parameter?
Heres what i have....
any thoughts @DamoBird365
Under review
Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.
Congratulations to our 2026 Super Users!
Congratulations to our 2025 community superstars!
These are the community rock stars!
Stay up to date on forum activity by subscribing.
David_MA 250 Super User 2026 Season 1
Expiscornovus 222 Most Valuable Professional
Haque 174