Hi
I have set up a from that allows user a choice of what service they require from us. Do they want to retrieve records from our warehouse or do they want us to collect records to store for them. If they want us to collect records we ask them to attach a template to the form of the records we need to collect.
I have set up a flow where when a form is submitted the data populates a request List (set up in Microsoft Lists) and then there is an action to add the template. All seems to be working well and data is populating the list, however I am getting the above error message when staff select the retrieve option and don't have to attach a template to the request. Is there a way of making the flow just apply this action when collection is selected?
Error message
The execution of template action 'Apply_to_each' failed: the result of the evaluation of 'foreach' expression '@json(outputs('Get_response_details')?['body/r880f970ae6954f689189a39c62458eb7'])' is of type 'Null'. The result must be a valid array.
Thank you
Hi @AndyW123
May be you can use below condition to check whether the dynamic content is null or not?
Like below :
Hope it helps !
Nived N 🚀
LinkedIn: Nived N's LinkedIn
YouTube: Nived N's YouTube Channel
🔍 Found my answer helpful? Please consider marking it as the solution!
Your appreciation keeps me motivated. Thank you! 🙌
i think you could be right, my flow is asking to select something every time even though there is no file there every time. is there a action i can add to correct this?
Hi @AndyW123
Show me the dynamic content on which you are looping ?
I think you have to add a condition which checks whether the looping item has null value or not ?
Nived N 🚀
LinkedIn: Nived N's LinkedIn
YouTube: Nived N's YouTube Channel
🔍 Found my answer helpful? Please consider marking it as the solution!
Your appreciation keeps me motivated. Thank you! 🙌
Hopefully this is what you were looking for
Hi @AndyW123
could you share a screenshot of your flow, that would be helpful 🙂
Nived N 🚀
LinkedIn: Nived N's LinkedIn
YouTube: Nived N's YouTube Channel
🔍 Found my answer helpful? Please consider marking it as the solution!
Your appreciation keeps me motivated. Thank you! 🙌
Yes @Nived_Nambiar some data returns through the form will have the template attached and some will not have a template attached.
It is the ones without the attached template that i am getting the error response on
Hi @AndyW123
to be clear, some data is entered in forms with file (template) attached to the form, the flow should create list item for that data entered along with template file attached.
am i right ?
Nived N 🚀
LinkedIn: Nived N's LinkedIn
YouTube: Nived N's YouTube Channel
🔍 Found my answer helpful? Please consider marking it as the solution!
Your appreciation keeps me motivated. Thank you! 🙌
Tomac
986
Moderator
stampcoin
699
Super User 2025 Season 2
Riyaz_riz11
577
Super User 2025 Season 2