我有一個回傳以下 JSON 的外部 api:-
{
"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",
"[email protected]",
"Miami",
"33",
"Florida",
"",
"",
""
],
[
"1",
"Richie",
"Hot",
"[email protected]",
"Miami",
"331",
"Florida",
"",
"",
""
],
[
"2",
"Jeff",
"Hot",
"[email protected]",
"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
}
現在我想遍歷 data[] 陣列中的專案,那么我該怎么做呢?
現在我撰寫了一個測驗流程,并使用上面的 JSON 作為輸入和模板創建了一個 Parse JSON 動作,然后我將得到這些..所以我只得到 rowType..所以我如何回圈遍歷 data[] 陣列在rowType里面?

謝謝
uj5u.com熱心網友回復:
我將您的資料加載到一個名為的物件變數中Data,然后For each在其下構造了一個動作......

截圖中的表達方式簡直...
variables('Data')['data']
這將遍歷您的data元素陣列。
要獲取每個專案(在本例中為array),請遵循此模式。
首先,初始化一個Array ...Initialize Item型別的變數(頂部箭頭,稱為變數)。

然后在For each回圈中,使用Current item動態物件設定該變數(如圖所示)。
你將從那里得到你的結果。
結果 ...

轉載請註明出處,本文鏈接:https://www.uj5u.com/qukuanlian/490938.html
