Hello - I have a Microsoft Form to retrieve data from technicians in the field and save it to a SharePoint list. To save the responses to the SharePoint list, I am using the "Record form responses in SharePoint template".
The form has branching logic, and photos are required for one branch. To save the photos to the list as well as the responses, I am using the "Apply to each" control. In the form, there is a second question to include additional photos. The second item is not required and is applicable to all branches.
When I execute a form path where photos aren't required, I believe the value in the control is null which causes a problem. I have issues when photos are not uploaded in the required field (because photos are only required for one of the paths). Geez! A lot of explanation, sorry.
Here is the overview of the flow, and I provided the details of the area where I'm getting stuck (failure message). Any help is appreciated. Thanks!
Error message: The execution of template action 'Apply_to_each_attachment' failed: the result of the evaluation of 'foreach' expression '@json(outputs('Get_response_details')?['body/r63a3dee2e10048d2afc5fc9e83944418'])' is of type 'Null'. The result must be a valid array.
Flow Overview:

Detail for Apply to Each control:

Error:
