Hi,
What is the best way to manipulate complex JSON objects?
For example I want to update an existing, already posted adaptive card and I want to toggle the visibility of a button based on some action.. I can retrieve the adaptive card using a GetMessageDetails action, but then updating a deeply nested property of the Adaptive Card is almost impossible to do. The SetProperty function does not allow to provide a path. Instead it offers an overloaded method where you can specific the parent object, but even that I am not able to get that properly working.
Below is an oversimplification of the adaptive card I have.
How can I easily update the isEnabled property using JSON manipulation where the property is nested inside multiple arrays?
{
"type": "AdaptiveCard",
"body": [
{
"type": "TextBlock",
"size": "Medium",
"weight": "Bolder",
"text": "text test stestes"
},
{
"type": "ColumnSet",
"columns": [
{
"type": "Column",
"width": "auto"
},
{
"type": "Column",
"width": "stretch"
}
]
},
{
"type": "ActionSet",
"actions": [
{
"type": "Action.Submit",
"title": "Acknowledge",
"isEnabled": true,
"data": {
"action": "acknowledge",
"uid": "uniqueId"
}
},
{
"type": "Action.Submit",
"title": "Resolve",
"isEnabled": false,
"data": {
"action": "resolve",
"uid": "uniqueId"
}
},
{
"type": "Action.Submit",
"title": "Close",
"isEnabled": false,
"data": {
"action": "close",
"uid": "uniqueId"
}
}
]
}
],
"$schema": "http://adaptivecards.io/schemas/adaptive-card.json",
"version": "1.6"
}