cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
soooofunny
Helper II
Helper II

Combine the output results of SQL Server into one.

Hey guys.

I'm in trouble. I need your help.
I have a Power Automate connector that connects to SQL Server.
The result is what I wanted.

If there are multiple results, they are in JSON format? The results are displayed in JSON format?
I don't know how to handle this.

[
  {
    "UserCode": "12345"
  },
  {
    "UserCode": "45678"
  },
  {
    "UserCode": "14785"
  }
]
 

The output looks like this, but I have to change the format to something like the following
I would like to send it by e-mail in the format below.

 

-------------------------------------------------------------

(I want it to appear like this in the body of the email)

12345

45678

14785

-------------------------------------------------------------


Can someone please tell me how to do this?
Thank you very much.

1 ACCEPTED SOLUTION

Accepted Solutions
gabibalaban
Super User II
Super User II

@soooofunny ,

You can use a string variable to get your values and iterate through the SQL results.

 

gabibalaban_0-1624103471956.png

I used Parse Json action to simulate the JSON answer from SQL.

 

Hope it helps !

View solution in original post

5 REPLIES 5
gabibalaban
Super User II
Super User II

@soooofunny ,

You can use a string variable to get your values and iterate through the SQL results.

 

gabibalaban_0-1624103471956.png

I used Parse Json action to simulate the JSON answer from SQL.

 

Hope it helps !

View solution in original post

Hi, @gabibalaban 

 

I'm sorry I didn't understand your explanation.

I don't know how to parse JSON.

 

The rest of the time, I mimicked your answers.

34321.png

Thanks.

@soooofunny 

You don’t need the parse JSON action, the SQL query result is received as JSON. All you have to do is to initialize a string variable, to use an Apply to each action to body (‘SQL action’) and inside it an Append to string variable (the initialized variable).

@gabibalaban 

 

I understood, to a point.
Is the content like the captured image correct?

 

165803.png

I was able to put them one by one into the test2 variable, but if I want to combine them into one, how can I do that?

Thanks.

@gabibalaban 

 

I'm so sorry.

I guess I was very wrong.

The way you taught me, the variables were neatly packed into one.

 

I am very grateful to you.

Thanks.

 

Helpful resources

Announcements
Process Advisor

Introducing Process Advisor

Check out the new Process Advisor community forum board!

MPA User Group

Welcome to the User Group Public Preview

Check out new user group experience and if you are a leader please create your group

V3_PVA CAmpaign Carousel.png

Community Challenge - Giveaways!

Participate in the Power Virtual Agents Community Challenge

Carousel 2021 Release Wave 2 Plan 768x460.jpg

2021 Release Wave 2 Plan

Power Platform release plan for the 2021 release wave 2 describes all new features releasing from October 2021 through March 2022.

Users online (2,852)