I'm having a hard time to visualise a complex Json return in powerapps:
There is a public api available for fetching scores of gym tournaments link to API
and I would like to give it visability in galery's/tables.
(check the link for the json)
In the app i use a gallery to show the names and the score:
If(!IsBlank(VarSelectedEvent),ScoreExpress_1.GetScores(VarSelectedEvent,GalleryRankings.Selected.id).data.items,Blank())
the result is a list of records with a single line of formatted text composed from the record-content:
ThisItem.ranking.place & Char(9) & First(ThisItem.participation.names).Value & Char(9) & " Score: " & ThisItem.ranking.score & Char(9) & ThisItem.participation.club & First(First(ThisItem.participation.scores).exercises).total & Char(9)
But for each record I would like to show the nested tables with scores: (this part)
"scores":[
{
"round":0,
"exercises":[
{
"total":"42.070",
"passes":[
{
"total":"42.070",
"values":[
{
"label":"diff",
"value":"1.600"
},
{
"label":"ToF",
"value":"14.020"
},
{
"label":"exec",
"value":"17.000"
},
{
"label":"hd",
"value":"9.450"
},
{
"label":"pen",
"value":"0.000"
}
]
}
],
"roundId":"097b776b7cc5dca41577aa53f2a821aa",
"exerciseTypeId":"tra-exercise-1",
"status":"finished"
},
{
"total":"47.600",
"passes":[
{
"total":"47.600",
"values":[
{
"label":"diff",
"value":"8.200"
},
{
"label":"ToF",
"value":"13.800"
},
{
"label":"exec",
"value":"16.000"
},
{
"label":"hd",
"value":"9.600"
},
{
"label":"pen",
"value":"0.000"
}
]
}
],
"roundId":"097b776b7cc5dca41577aa53f2a821aa",
"exerciseTypeId":"tra-exercise-2",
"status":"finished"
}
]
}
],
"aaResults":null
}
I tried this approach in the onselect of a record in the galery, but I don't seem to get there:
ClearCollect(ColScores,ThisItem.participation.scores);
Clear(ColRealTable);
ForAll(ColScores As TableScores, Collect(ColRealTable, {naam:TableScores.exercises}));
ForAll(ColRealTable As RealTableScores, Collect(ColRealTableValues, {test:RealTableScores.naam}));
//ForAll(ColRealTableValues As RealTableValues, Collect(ColRealTableValuesLast,{discipline:ThisRecord.label}))
any suggestions on how to get the nested tables formatted without losing the hierarchy?
Any help would be appreciated!