Hello!
I've been working on a small project to have a Flow read the contents of a SharePoint list and build a card based on a field (email of the person responsible) to get updates on a few other fields.
After some time digging around on how to build dynamic adaptive cards, I found the way to do it and get responses coming back.
The problem is that as I need to create a dynamic card the "ID" response has to change and as I need more than 1 answer, I append a letter to the beginning of the ID to differentiate each answer.
The result is an object(?) with this structure:
[
{
"M1": "True",
"A1": "Variable Text1",
"M2": "False",
"A2": "Variable Text2"
}
]
and if I append it to an array, I get this structure:
[
{
"M1": "False",
"A1": "Variable Text1",
"M2": "False",
"A2": "Variable Text2",
},
{
"M3": "True",
"A3": "Variable Text3"
}
]
As mentioned before, the ID of the SharePoint list is the number after the A or M in the key. Therefore, what I am trying to do to complete this action and being able to update the list is to:
1) Remove the "M" and "A" from the key
2) Group the values based on the remainder of the key (so for these examples, 1 / 2 / 3) and add the ID field.
Something like:
[
{
"ID":1
"M":"False",
"A":"Variable Text1"
},
{
"ID":2
"M":"False",
"A":"Variable Text2"
},
{
"ID":3
"M":"True",
"A":"Variable Text3"
}
]