I have a SP list and am using a custom PowerApps form. The column is a Choice column and when I leave items as Choices([@'Controlled Locations'].Department) it updates the list fine but when I add Distinct like this Distinct(Choices([@'Controlled Locations'].Department),Value) to remove the duplicates it no longer updates the list. All other properties are left to the default. Any ideas why or how I can make this work?
Thanks
Solved! Go to Solution.
Hey @StephenGW, despite my first post probably sharing more wisdom, I did find a solution to this elsewhere and wanted to share with you.
In the Items property, keep Distinct(Choices([@'Controlled Locations'].Department),Value) as you have it.
In the Update property, write:
{
Value: yourlookupdatacard.Selected.Result,
Id:
LookUp(
'yourreferencelist',
thenameofthereferencecolumnwiththevaluethatmatchesyourselecteditem = yourlookupdatacard.Selected.Result
).ID
}
This way, it will update with a record even though the result of the distinct function is a value.
Hi @StephenGW ,
I tried it too on a choice column: no error message, choices are selectable but the list doesn't update.
I do wonder why you have a non-unique choices column: if it's somehow automatically filled, perhaps there's a way to filter distinct values at that time, instead of in the dropdown?
Succes,
Marc
Sorry, I misspoke it is a LookUp column looking at a SP list of locations. So the first column is similar to a city with the second column being like a building and finally the last column is the building directory. So the first column would have many repeats of say New York and then several buildings in the second column which would also then repeat some too like building 1, building 2, ect. Then the third column would be like room12, room 13, ect. I'm not sure I can filter these this way.
Anybody have any ideas why it won't work when I try to remove the duplicates?
Hi Stephen,
I've had an almost identical situation. I believe the issue is due to the distinct function giving an output of distinct text values. The filter function will do the same thing. The problem there is that the SP list wants a record. Unfortunately, I haven't found a solution. See the thread I made here.
Hey @StephenGW, despite my first post probably sharing more wisdom, I did find a solution to this elsewhere and wanted to share with you.
In the Items property, keep Distinct(Choices([@'Controlled Locations'].Department),Value) as you have it.
In the Update property, write:
{
Value: yourlookupdatacard.Selected.Result,
Id:
LookUp(
'yourreferencelist',
thenameofthereferencecolumnwiththevaluethatmatchesyourselecteditem = yourlookupdatacard.Selected.Result
).ID
}
This way, it will update with a record even though the result of the distinct function is a value.
That did it! Thank you for this solution!
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 | |
45 | |
45 | |
34 | |
34 |
User | Count |
---|---|
257 | |
82 | |
78 | |
67 | |
65 |