I have created a flow which when Power apps has button pressed , I wanted to bring in some data from a powerbi table and save that data as a collection using this script
Set(crm_skeds,crm_skeds_aged.Run().skeds_aged);
ForAll(Table(ParseJSON(crm_skeds)),Collect(collData,{Code: ThisRecord.Value.Code}))
My flow is reading the data from pbi fine , but it is adding [] to the column names , which I think is one of the issues
Code to read in data is
EVALUATE
SELECTCOLUMNS(
TOPN(1000, crm),
"carrier_code", crm[carrier_code],
"region", crm[region],
"certified_date", crm[certified_date],
"received_date", crm[received_date]
)
After reading in the code , I added an initialize variable
{
"type": "InitializeVariable",
"inputs": {
"variables": [
{
"name": "vrSkeds",
"type": "array",
"value": "@outputs('Run_a_query_against_a_dataset')?['body/firstTableRows']"
}
]
},
"runAfter": {
"Run_a_query_against_a_dataset": [
"Succeeded"
]
}
}
and the respond to a power app or flow is
{
"type": "Response",
"kind": "Http",
"inputs": {
"statusCode": 200,
"body": {
"skeds_aged": "@{variables('vrSkeds')}"
}
},
"runAfter": {
"Initialize_variable": [
"Succeeded"
]
}
}