OK Flownauts -- need your help please!
I have a seemingly simple flow - I am running a SQL Server Stored Procedure via an on-premise gateway. The SP runs fine and returns data. I currently have it set up to only return a single row (TOP 1) for testing purposes.
I then pass the result set to a Parse JSON so I can readily utilize the variable data fields. I used the payload to create the schema and the parse runs fine, rendering all the data into the proper variable names.
I then try to use the output of the Parse JSON to create an SP item and that is where I hit the error.
"The execution of template action 'Apply_to_each_2' failed: the result of the evaluation of 'foreach' expression '@body('Parse_JSON')?['ResultSets']?['Table1']' is of type 'Null'. The result must be a valid array."
I have tried everything I can think of to debug the issue by trying to simplify to isolate the problem:
1. I deleted and readded the create item (several times).
2. I created a brand new SP List with only the title column and tried to use it instead of the one I really want to use
3. I tried storing the results set from the SP in an object variable and passing that to the Parse JSON (this seemed to solve the problem for the person in this post: https://powerusers.microsoft.com/t5/Using-Flows/Stored-Procedure-Table1-is-of-type-Null/m-p/317851)
4. I removed the create item completely and instead used a initialize variable / set variable pair to try to save the contents of the Name field from the Parse JSON to a string variable.
All resulted in the same error, as shown above, on the Apply to Each.
The image below is based on the simplest case, #4 in the list above. Left side is the flow deta - right side is the result of running the flow. You can see the Parse JSON is executing successfully and contains the output I would expect to see in each field. But when I try to use it... the flow fails every time.
How can I successfully utilize the JSON output???? This one has me baffled.
LRVinNC