Forum Discussion

peter's avatar
peter
New Contributor III
6 years ago
Solved

Convert data from SQL select to JSON

What is the best way to take data from a SQL Select statement and convert to JSON so that it can be used in a API put commend?

5 Replies

  • darshthakkar's avatar
    darshthakkar
    Valued Contributor

    Thank you @Soni37 for sharing the documentation link as well as the solution. That worked!
    I, unfortunately cannot mark that as a solution as I’m not the author of the original post.

    @dmiller - can you please do the needful, I’m sure you have the rights to do that.
    Thank you.

    Regards,
    Darsh

  • Hello Peter, welcome to the SnapLogic Community! SnapLogic is a JSON-based platform so what that means to you while working in the Designer is that every snap with a circular input or output is communicating through JSON, including the SQL Server Select snap results or a SELECT statement written in SQL Server Execute snap. Here’s a screenshot example:

    • peter's avatar
      peter
      New Contributor III

      Great that worked a treat.

      Thanks

  • darshthakkar's avatar
    darshthakkar
    Valued Contributor

    @rsramkoski - can we add one more layer to this JSON structure? If yes, how could we do that?
    I tried using Group By N with Group Size = 1 however I’m not getting the desired output.

    Screenshot after using Group By N:

    Desired Output:

    Need to add one more layer so that the JSON output becomes nested.
    Thanking in advance for your help.

    Regards,
    Darsh