skip to Main Content

Creating a logic app to retrieve data from SQL server in JSON format.

Calling SQL Stored Proc from Logic App trigged via HTTP Request.

And using below select Query – FOR JSON to create the output as JSON and using ResultSet in the response of Logic App.

SELECT ID, NAME FROM #TABLENAME FOR JSON PATH, ROOT('Data')

enter image description here

But I’m getting the ResultSet along with Table and column name created by SProc select statement.
Which was along with output from Stored Proc and included in the ResultSet of SProc.

enter image description here

screenshot of output from stored proc

Does anyone know a method to remove this highlighted output from result set in Stored Proc output?

Output Expected –

{"Pulse Data": [{"A":"cc", "B":"ZZ"},{"A":"dd", "B":"YY"}, {"A":"ee", "B":"XX"}]}

2

Answers


  1. I had reproduced the same in my local environment and got succeeded.

    enter image description here

    By doing this below approach in Azure Logic Apps, and achieved the required result:

    enter image description here

    Here is the excepted result:
    enter image description here

    Login or Signup to reply.
  2. I had the same issue yesterday. I was able to resolve this by wrapping the query in to an output variable in the stored procedure, then using the output parameters in the logic app.

    PROCEDURE [dbo].[Something_to_JSON] @JSON NVARCHAR(MAX) OUTPUT
    
    SELECT @JSON = ( SELECT DISTINCT something, something
    

    Logic App HTTP

    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search