Hi
Can anyone advise how I can use the DISTINCT function in a dropdown but still get access all the columns in the row. For example, I have a few rows with the same "Project Name" and I just want to see only one occurrence of the row but still get access to all columns. I can use DISTINCT but then this only provides the single column to use elsewhere and not the whole row.
Many thanks.
Brilliant - I'll give it another go.
Much appreciated.
@jed76 ,
No - GroupBy() does the same thing except the "Data" field is actually a table containing all the other fields matching it - which you simply get back with AddColumns and use the first record in each table. Your code should work
AddColumns(
GroupBy(
'CRUD 2',
"field_1",
"Data"
),
"field_2",
First(Data).field_2,
"field_3",
First(Data).field_3
)
Please click Accept as solution if my post helped you solve your issue. This will help others find it more readily. It also closes the item. If the content was useful in other ways, please consider giving it Thumbs Up.
Visit my blog Practical Power Apps
I am unsure where to put this. The field I want to use is 'field_1'. Should there also still be the DISTINCT function somewhere as well?
AddColumns(
GroupBy(
'CRUD 2',
"field_1",
"Data"
),
"field_2",
First(Data).field_2,
"field_3",
First(Data).field_3
)
@jed76 ,
Can you please post your code (in Text) and also the field you are displaying in the drop-down (it should be the GroupBy (Distinct) column.
I think I have got the function working now without an error but where does the function sit? I have put as ITEMS in the dropdown box, but now nothing shows when I select the dropdown?!
Many thanks.
Sorry, what is "your distinct column" then? What is the difference between this and "field1"?
Hi @jed76 ,
Field1 was only a placeholder - put the actual name of the field you want to retrieve in both places. Note you will get the first field in each distinct set.
Please click Accept as solution if my post helped you solve your issue. This will help others find it more readily. It also closes the item. If the content was useful in other ways, please consider giving it Thumbs Up.
Visit my blog Practical Power Apps
Aah yes - I see. I will give that a go. Many thanks!
In the dropdown, yes, my suggestion was to use that dropdown to cycle through projects and get their details in a gallery.
@WarrenBelz may be closer to what you are looking for.
Hi
Many thanks. I have tried this, but when I set the Dropdown to colDistinct, I can still only access the "result" from this, namely the single column?
WarrenBelz
637
Most Valuable Professional
stampcoin
570
Super User 2025 Season 2
Power Apps 1919
473