Hello,
I am receiving the following error when i run my flow:
The execution of template action 'Apply_to_each_4' failed: the result of the evaluation of 'foreach' expression '@triggerBody()?['AdminServices']' is of type 'Null'. The result must be a valid array.
I have initialize Variable type as string before it gets to this step and other variable and apply to each similar to the AdminServices which runs before hand with no issues. It gets stuck at the adminservices section even though this field in the SP List is set up exactly the same as the previous steps.
This is the step that is causing the issues:
would anyone have any advice on how i can fix this please?
thanks
Alistair
Hi @eric-cheng
It was me being stupid, I had set the choice fields in the SP list slightly differently. should have allowed multiple responses but hadn't selected that option.
thanks for your help, it's now working
Hi @neill_long ,
Can you screenshot the field settings in SharePoint for both fields?
--------------------------------------------------------------------------
If I have answered your question, please mark my post as a solution
If you have found my response helpful, please give it a thumbs up
Connect on LinkedIn
Hi @eric-cheng
It is empty but I have also tested it where there was data in the field and still got the same message.
I put a Compose prior to it and the output was empty, but i dont understand why it worked on the step before for LearnerEngage. This is a similar field in the same SP List and it was empty too.
Would there be a setting on the field in the SP List that i am missing that it doesn't recognise it? The error message mentions a valid array, but the initialize variable i have specified as string
Hi @neill_long ,
Looks like AdminServices is empty? Can you add a Compose action prior to your loop and confirm the output?
You can add a condition to check if empty(triggerBody()?['AdminServices']) is true or not and only loop when it is false.
--------------------------------------------------------------------------
If I have answered your question, please mark my post as a solution
If you have found my response helpful, please give it a thumbs up
Connect on LinkedIn