I need to extract the list of property names from a dynamic json string. The following is a simplified version. How can I get an array of ["xxxxxxx","zzzzzzzzzzzzz"]
this is BRILLIANT! Thank you
Don't do this with string operations 😣
Compose: Your flow's JSON
Select From:
xpath(
xml(json(concat('{"root":', outputs('Compose'),'}}'))),
'/root/*'
)
Select Map:
xpath(
item(),
'name(/*)'
)
Only downside: You might have to handle XML encoding of characters that are not allowed as node names.
Output:
This is a good start. There was a lot more to the json that I redacted. That extra content makes the
take(split(string(variables('DynamicJSON')),'}'),sub(length(split(string(variables('DynamicJSON')),'}')),2))
result in a lot more elements, that are still hard to parse. Here is the complete string, but i altered the data.
I really appreciate the assistance!!!!!!!!
{
"Get_items": {
"runAfter": {},
"metadata": {
"operationMetadataId": ""
},
"type": "OpenApiConnection",
"inputs": {
"host": {
"connectionName": "",
"operationId": "",
"apiId": ""
},
"parameters": {
"dataset": "",
"table": ""
},
"authentication": ""
}
},
"Get_items_2": {
"runAfter": {
"Get_items": [
"Succeeded"
]
},
"metadata": {
"operationMetadataId": ""
},
"type": "",
"inputs": {
"host": {
"connectionName": "",
"operationId": "",
"apiId": ""
},
"parameters": {
"dataset": "",
"table": ""
},
"authentication": ""
}
}
}
agree, i tried that
Hi @darylvogan ,
I've made a test for your reference:
1)
take(split(string(variables('DynamicJSON')),'}'),sub(length(split(string(variables('DynamicJSON')),'}')),2))
2)
split(split(item(),'"')[1],'"')[0]
Result
Best Regards,
Bof
replace the outer { and } with [ and ]
Edit: no, doesn't work.
Michael E. Gernaey
497
Super User 2025 Season 2
David_MA
436
Super User 2025 Season 2
Riyaz_riz11
244
Super User 2025 Season 2