I am trying to follow the instructions in the link below to automatically update a layer after submitting a survey in Survey123
https://resources.esri.ca/getting-technical/webhooks-microsoft-flow-and-the-arcgis-rest-api-automating-your-web-gis
However i am failing at the final hurdle and receiving this error message
https://resources.esri.ca/getting-technical/webhooks-microsoft-flow-and-the-arcgis-rest-api-automating-your-web-gis

The execution of template action 'While_Loop' failed: the result of the evaluation of 'foreach' expression '@{body('Parse_Query_JSON')?['objectIds']}
' is of type 'String'. The result must be a valid array.
Can anyone give me some idea as to what i am doing wrong?