
Announcements
collect(test, {demo:a}, {demo:b}, {demo:c});
I want to get index number of 1 for a;
I want to get index number of 2 for b;
I want to get index number of 3 for c;
How to get?
Hi @Camille666 ,
With your collection created, you can add the following Power Fx to the items property of a gallery (for example) to get the row numbers/index:
// Apply row number to collection
Ungroup(
ForAll(
Sequence(CountRows(test)),
{
Record: Table(Index(test,Value)),
RowNumber: Value
}
),
"Record"
)
If you needed the indexed values in a collection, you could do something like:
// Build test collection
ClearCollect(test, {demo:"a"}, {demo:"b"}, {demo:"c"});
// Apply row number to collection
ClearCollect(testIndexed,
Ungroup(
ForAll(
Sequence(CountRows(test)),
{
Record: Table(Index(test,Value)),
RowNumber: Value
}
),
"Record"
))
------------------------------------------------------------------------------------------------------------------------------
If I've answered your question, please mark your post as Solved. You can accept more than one post as a solution.
If my response was a good one, please give it a Thumbs Up!
Visit my blog: https://platformsofpower.net