Hello @CodingCarnage ,
I used the following solution:
In the stored procedure:
DECLARE @ResultsTable TABLE (ErrorMessage varchar(500), ErrorCode VARCHAR(10), ReturnData NVARCHAR(MAX), ReturnMessage NVARCHAR(MAX))
Insert the desired values in the table:
INSERT INTO @ResultsTable(ErrorMessage, ErrorCode, ReturnData , ReturnMessage)
VALUES ('1', '2', '3' , '4');
at the end of the stored procedure:
SET @JSON_OUTPUT= (SELECT ErrorMessage, ErrorCode, ReturnData , ReturnMessage from @ResultsTable FOR JSON AUTO, INCLUDE_NULL_VALUES )
end
In MS Flow use a parse JSON after the execution of the stored procedure:
https://ibb.co/w7cH6Rz
Put this in schema:
{
"type": "array",
"items": {
"type": "object",
"properties": {
"ErrorMessage": {
"type": [
"string",
"null"
]
},
"ErrorCode": {
"type": [
"string",
"null"
]
},
"ReturnData": {
"type": [
"string",
"null"
]
},
"ReturnMessage": {
"type": [
"string",
"null"
]
}
}
}
}
Then you call the flow in PowerApps UpdateContext({flowResult: Flow.run(parameters of flow)})
Hope this helps.