web
You’re offline. This is a read only version of the page.
close
Skip to main content

Notifications

Announcements

Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Automate / Access JSON data furth...
Power Automate
Unanswered

Access JSON data further in with SELECT

(0) ShareShare
ReportReport
Posted on by 21

Hello Community. 

Hope this have not been asked because i could not find anything about it. 

 

My situation

1. I read data from SQL with a query 

2. I parse the data with a JSON

3.  I initialise a variable since else i got error about type

4. I append to a array

5. I use a select to take out certain data from the array 

 

Here is the data in the array:

 

{
 "ResultSets": {
 "Table1": [
 {
 "EwonName": "47",
 "TidPunkt": "2020-11-17T18:18:09Z",
 "Name": "TankConductivity",
 "Value": "0.381624698638916"
 },
 {
 "EwonName": "12",
 "TidPunkt": "2020-11-17T21:05:08Z",
 "Name": "TotalPermeateVolume",
 "Value": "11600"
 },
 {
 "EwonName": "44",
 "TidPunkt": "2020-11-17T12:34:44Z",
 "Name": "TotalPermeateVolume",
 "Value": "36730"
 }
 ]
 },
 "OutputParameters": {}
}

 

I can read out all the data with the select from the array with this function 

 

first(variables('test1'))['ResultSets']

 

 

but then it gets messy in my send email funktion.

 

{"Table1":[{"EwonName":"33","TidPunkt":"2020-11-17T18:18:09Z","Name":"TankConductivity","Value":"0.381624698638916"},{"EwonName":"21","TidPunkt":"2020-11-18T05:05:02Z","Name":"TankConductivity","Value":"1.1649608612060547"},{"EwonName":"21","TidPunkt":"2020-11-18T04:30:22Z","Name":"TankConductivity","Value":"0.6224169731140137"},{"EwonName":"21","TidPunkt":"2020-11-17T22:41:21Z","Name":"TankConductivity","Value":"1.3767967224121094"},{"EwonName":"21","TidPunkt":"2020-11-17T05:41:04Z","Name":"TankConductivity","Value":"0.4563007354736328"},{"EwonName":"76","TidPunkt":"2020-11-17T21:04:08Z","Name":"TankConductivity","Value":"0.49059104919433594"},{"EwonName":"88","TidPunkt":"2020-11-17T17:11:53Z","Name":"TankConductivity","Value":"15.792694091796875"},{"EwonName":"prototype","TidPunkt":"2020-11-17T12:34:44Z","Name":"TankConductivity","Value":"0.47496986389160156"},{"EwonName":"1121","TidPunkt":"2020-11-17T12:29:49Z","Name":"TankConductivity","Value":"1.8328537940979004"},{"EwonName":"0606","TidPunkt":"2020-11-18T03:03:12Z","Name":"TankConductivity","Value":"0.46506404876708984"},{"EwonName":"1","TidPunkt":"2020-11-17T21:05:08Z","Name":"TankConductivity","Value":"0.534024715423584"},{"EwonName":"6","TidPunkt":"2020-11-

 

 I want it to be listed as this ( just an example )

goal.png

 

I found a tutorial where the author listed the variables like this in his select and then he could call them very nicely in the send email function

tut.png

But he do not call the data from a SQL so i cant do it exact the same way as him. 

 

So how would i do the same but from a JSON array, If i want to read out the EwonName etc?

Or any other smart way? 

Untitled.png

 

Here is the full flow 

fullflow.png

 

Categories:
I have the same question (0)
  • v-siky-msft Profile Picture
    on at

    Hi @Emil2 ,

     

    Please first to use the following expression to output the Table1 Array, and use Parse JSON step to parse it, then use Body dynamic content of Parson JSON to create HTML table.

    first(variables('test1'))['ResultSets']['Table1']

    Snipaste_2020-11-19_17-59-07.png

    Test outcome:

    Snipaste_2020-11-19_17-58-01.png

    Hope this helps.

    Sik

     

  • Emil2 Profile Picture
    21 on at

    Thank you very much, However i dont think i get the schema correct?

     

    error.png

     

    How do your schema looks? 

    Or do i missunderstand your flow, should i add a new parse JSON after the select and before the create html table

    or should i remove everything before my Parse JSON and Create HTML? 

     

    All the best 

    /Emil2

  • Verified answer
    v-siky-msft Profile Picture
    on at

    Hi @Emil2 ,

    Notice 'Table1' is an Array, instead of an Object, please try to put the following sample data of Table1 to sample payload to generate the JSON schema.

    [
     {
     "EwonName": "47",
     "TidPunkt": "2020-11-17T18:18:09Z",
     "Name": "TankConductivity",
     "Value": "0.381624698638916"
     },
     {
     "EwonName": "12",
     "TidPunkt": "2020-11-17T21:05:08Z",
     "Name": "TotalPermeateVolume",
     "Value": "11600"
     },
     {
     "EwonName": "44",
     "TidPunkt": "2020-11-17T12:34:44Z",
     "Name": "TotalPermeateVolume",
     "Value": "36730"
     }
     ]

     

    With regard to flow steps, only need to replace the 'Select' action by 'Parson JSON' action, and then use the parsed Body to create HTML Table.

     

    Hope this helps.

    Sik

  • Emil2 Profile Picture
    21 on at

    That made it. 

     

    Thank you very much

     

    /Emil2

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Forum hierarchy changes are complete!

In our never-ending quest to improve we are simplifying the forum hierarchy…

Ajay Kumar Gannamaneni – Community Spotlight

We are honored to recognize Ajay Kumar Gannamaneni as our Community Spotlight for December…

Leaderboard > Power Automate

#1
Michael E. Gernaey Profile Picture

Michael E. Gernaey 522 Super User 2025 Season 2

#2
Tomac Profile Picture

Tomac 364 Moderator

#3
abm abm Profile Picture

abm abm 243 Most Valuable Professional

Last 30 days Overall leaderboard