Hi,
I have the following problem with my flow. Namely, I have a variable 'sourceData' of type array based on which I group the data into an object variable 'groupedData' based on one column 'Service'. This works fine, as a result I get a variable containing data in the following format:
{
"body": {
"name": "groupedData",
"value": {
"Digital Private": [
{
"@odata.etag": "",
"ItemInternalId": "c2e3b85b",
"Number": "31266",
"Service": "Digital Private",
"Approval": "2024-05-07T07:57:37.000Z",
"State": "Closed"
}
],
"Trading": [
{
"@odata.etag": "",
"ItemInternalId": "9d967542",
"Number": "29756",
"Service": "Trading",
"Approval": "2024-05-16T15:15:17.000Z",
"State": "Closed",
},
{
"@odata.etag": "",
"ItemInternalId": "6b1b6998",
"Number": "31519",
"Service": "Trading",
"Approval": "2024-05-06T13:02:21.000Z",
"State": "Closed"
}
],
"Digital Guide": [
{
"@odata.etag": "",
"ItemInternalId": "89a40159",
"Number": "31585",
"Service": "Digital Guide",
"Approval set": "2024-05-01T10:26:17.000Z",
"State": "Closed"
}
]
}
]
}
In the next step, out of each group (Digital Private, Trading, Digital Guide etc., I need to take one random record and create a 'finalData' variable of type array, which I will use later.
I have no idea how to do that, I were trying with using keys(), but I have an error
"The variable 'keysArray' of type 'Array' cannot be initialized or updated with value of type 'String'. The variable 'keysArray' only supports values of types 'Array'."
I have already lost my ideas.
Thank you in advance for help!
Max