
I am fetching details from SAP and after approval I want to create order in SAP using MuleSoft API. I am trying to create payload to pass to MuleSoft to create order, however I am unable to add array of items in payload, please help me to create payload.
Payload I want to create using PowerApps:
{
"SOT": "ABC",
"SOrg": "B433",
"DC": "00",
"OD": "20",
"SG": "B45",
"SO": "B433",
"STP": "6473826",
"CD": "/Date(1665028800000)/",
"CBU": "Test",
"POC": "Buyin Test 2",
"CPOD": "/Date(1665028800000)/",
"SOD": "/Date(1665028800000)/",
"TNA": "0",
"TC: "USD",
"PD": "/Date(1665028800000)/",
"RDD": "/Date(1665028800000)/",
"to_Item": [
{
"SOT": "10",
"SOIC": "XYZ",
"Material": "34899",
"PD": "/Date(1665028800000)/",
"RQ": "2",
"RQU": "EJF",
"IW": "KG",
"TC": "USD",
"Batch": "J002Q9345",
"PP": "PY50",
"SL": "UR02",
"SP": "IE02",
"PC": "B987",
"RD": "",
"RDI": "0"
},
{
"SOT": "10",
"SOIC": "XYZ",
"Material": "34899",
"PD": "/Date(1665028800000)/",
"RQ": "2",
"RQU": "EJF",
"IW": "KG",
"TC": "USD",
"Batch": "J002Q9345",
"PP": "PY50",
"SL": "UR02",
"SP": "IE02",
"PC": "B987",
"RD": "",
"RDI": "0"
}
]
}
The JSON function can generate this type of payload. The documentation includes examples of how to generate this type of JSON.
https://learn.microsoft.com/en-gb/power-platform/power-fx/reference/function-json