I have a collection that has a chance of duplicating records if 1 column is filled. I have 1 column that we will call "ID" and another column that we will call "Result". A sample collection would contain [ID: 1 - Result a ], [ID: 1 - Result b ], [ID: 1 - Result c ], [ID: 2 - Result d ], [ID: 3 - Result a ]. I would like to display a gallery with Each "Result" grouped by each ID. So in this case, my gallery would be 3 rows long. ID 1 would contain a, b, c. ID 2 would contain d. and ID 3 would contain a.If I Distinct by "ID", this will cause me to lose all my "Results". An example of what I mean is shown below from excel.
I tried a really complex ForAll loop but turns out Powerapps cannot update variables inside of a ForAll Loop. Results is a string so I was thinking of using Concat/Concatenate, but I just end up putting all results into all IDs. This is all within PowerApps Canvas.
Solved! Go to Solution.
To do this, you'd group your source collection by the ID column and Concat the results of the grouped column. The syntax would look like this:
AddColumns(
GroupBy(colData, "ID", "GroupedData"),
"ResultsConcat",
Concat(ThisRecord.GroupedData,Results & ", ")
)
To do this, you'd group your source collection by the ID column and Concat the results of the grouped column. The syntax would look like this:
AddColumns(
GroupBy(colData, "ID", "GroupedData"),
"ResultsConcat",
Concat(ThisRecord.GroupedData,Results & ", ")
)
Thank you so much! I can’t believe it was this simple.
The first Microsoft-sponsored Power Platform Conference is coming in September. 100+ speakers, 150+ sessions, and what's new and next for Power Platform.
This training provides practical hands-on experience in creating Power Apps solutions in a full-day of instructor-led App creation workshop.
User | Count |
---|---|
183 | |
46 | |
46 | |
34 | |
33 |
User | Count |
---|---|
260 | |
87 | |
79 | |
68 | |
67 |