I have an external api which return the following JSON:-
{
"resultSetMetaData": {
"page": 0,
"numPages": 2,
"numRows": 3,
"format": "json",
"rowType": [
{
"name": "FIRST_NAME",
"database": "PROD",
"schema": "RIC",
"table": "OWNER_VW",
"type": "text",
"scale": null,
"precision": null,
"nullable": true,
"byteLength": 16777216,
"collation": null,
"length": 16777216
},
{
"name": "LAST_NAME",
"database": "PROD",
"schema": "RIC",
"table": "OWNER_VW",
"type": "text",
"scale": null,
"precision": null,
"nullable": true,
"byteLength": 16777216,
"collation": null,
"length": 16777216
},
{
"name": "EMAIL",
"database": "PROD",
"schema": "RIC",
"table": "OWNER_VW",
"type": "text",
"scale": null,
"precision": null,
"nullable": true,
"byteLength": 16777216,
"collation": null,
"length": 16777216
},
{
"name": "CITY",
"database": "PROD",
"schema": "RIC",
"table": "OWNER_VW",
"type": "text",
"scale": null,
"precision": null,
"nullable": true,
"byteLength": 16777216,
"collation": null,
"length": 16777216
},
{
"name": "ZIP",
"database": "PROD",
"schema": "RIC",
"table": "OWNER_VW",
"type": "text",
"scale": null,
"precision": null,
"nullable": true,
"byteLength": 16777216,
"collation": null,
"length": 16777216
},
{
"name": "STATE",
"database": "PROD",
"schema": "RIC",
"table": "OWNER_VW",
"type": "text",
"scale": null,
"precision": null,
"nullable": true,
"byteLength": 16777216,
"collation": null,
"length": 16777216
},
{
"name": "ADDRESS",
"database": "PROD",
"schema": "RIC",
"table": "OWNER_VW",
"type": "text",
"scale": null,
"precision": null,
"nullable": true,
"byteLength": 16777216,
"collation": null,
"length": 16777216
},
{
"name": "PHONE",
"database": "PROD",
"schema": "RIC",
"table": "OWNER_VW",
"type": "text",
"scale": null,
"precision": null,
"nullable": true,
"byteLength": 16777216,
"collation": null,
"length": 16777216
},
{
"name": "UID",
"database": "PROD",
"schema": "RIC",
"table": "OWNER_VW",
"type": "text",
"scale": null,
"precision": null,
"nullable": true,
"byteLength": 16777216,
"collation": null,
"length": 16777216
}
]
},
"data": [
[
"0",
"HoT",
"Hot",
"No_Email@no-email.com",
"Miami",
"33",
"Florida",
"",
"",
""
],
[
"1",
"Richie",
"Hot",
"No_Email@no-email.com",
"Miami",
"331",
"Florida",
"",
"",
""
],
[
"2",
"Jeff",
"Hot",
"No_Email@no-email.com",
"Miami",
"33",
"Florida",
"",
"(0",
"4"
]
],
"code": "090001",
"statementStatusUrl": "/api/statements/01a4d180-0b03-2ad4-0000-f67903a02826?requestId=4d32040e-ba17-4936-a013-7dd7ab1797aa",
"requestId": "4d32040e-ba17-4936-a013-7dd7ab1797aa",
"sqlState": "00000",
"statementHandle": "01a4d180-0b03-2ad4-0000-f67903a02826",
"message": "Statement executed successfully.",
"createdOn": 1654725152956
}
now i want to loop through the items inside the data[] array, so how i can do so?
Now i wrote a test Flow and i create a Parse JSON action with the above JSON as the input and as the template, then i will get these.. so i only get rowType.. so how i can loop through the data[] array inside the rowType?
Thanks
Solved! Go to Solution.
Hi, @johnjohn123, if you simply want to loop through that data array either copy the following and paste it into the 'Select an output from previous steps' field:
|
Or tap the 'Expression' option next to 'Dynamic content' that you see in that pop-up when you are in that field, and paste in this:
|
Once you're in the Apply to each you should be able to work with the column names within 'data' by using this expression in the expression builder:
|
That will bring the first piece of data from a given data listing, 1 will give the second, etc.
Alternatively, if you'd like to create a more meaningful dataset, make a Select action. Then for each Key that you have named, select the appropriate value using the similar expression in the expression builder:
Key 1 |
|
Key 2 |
|
Key 3 |
|
... etc.
Hi, @johnjohn123, if you simply want to loop through that data array either copy the following and paste it into the 'Select an output from previous steps' field:
|
Or tap the 'Expression' option next to 'Dynamic content' that you see in that pop-up when you are in that field, and paste in this:
|
Once you're in the Apply to each you should be able to work with the column names within 'data' by using this expression in the expression builder:
|
That will bring the first piece of data from a given data listing, 1 will give the second, etc.
Alternatively, if you'd like to create a more meaningful dataset, make a Select action. Then for each Key that you have named, select the appropriate value using the similar expression in the expression builder:
Key 1 |
|
Key 2 |
|
Key 3 |
|
... etc.
The first Microsoft-sponsored Power Platform Conference is coming in September. 100+ speakers, 150+ sessions, and what's new and next for Power Platform.
Announcing a new way to share your feedback with the Power Automate Team.
Learn to digitize and optimize business processes and connect all your applications to share data in real time.
User | Count |
---|---|
68 | |
23 | |
17 | |
16 | |
13 |
User | Count |
---|---|
121 | |
35 | |
33 | |
28 | |
26 |