
Announcements
In Power Virtual Agent, I have a table like the following:
[
{
"Cells": [
{
"Key": "FirstName",
"Value": "Paul"
},
{
"Key": "LastName",
"Value": "McCartney"
},
{
"Key": "Instrument",
"Value": "Bass Guitar"
}
]
},
{
"Cells": [
{
"Key": "FirstName",
"Value": "George"
},
{
"Key": "LastName",
"Value": "Harrison"
},
{
"Key": "Instrument",
"Value": "Electric Guitar"
}
]
}
]
I'm trying to transform this data with a PowerFX Formula into the following:
[
{
"FirstName": "Paul",
"LastName": "McCartney"
},
{
"FirstName": "George",
"LastName": "Harrison"
}
]
Essentially, I want to loop over each item in the initial array, loop over each Cell, and select the Key and Value, where the value for Key is the name of a property I want to collect (in this example, FirstName and LastName). I've spent the past 2 days trying to get this to work, but am having no luck getting more than one property.
Any help would be greatly appreciated.
Hi there!
You can achive this result by using Ungroup and RenameColumns 🙂
RenameColumns(Ungroup(varInput,"Cells"), "Key", "FirstName", "Value", "LastName")