Hi,
i'm facing a problem.
i've made a collection named "colOwnersByPrd" that store the Owner value of record selected in a combobox.
I have a button "Search" and when i click on it, it supposed to filter a gallery that contain users from the systemuser entity. To do that, i'm trying to show only users where the guid is in the collection "colOwnersByPrd".
The problem is "colOwnersByPrd" result is a record type and the criteria of my filter doesn't match between guid and record type.
Here's the collection "colOwnersByPrd" definition :
Here's the filter code :
The message is "Cannot convert this Guid to Record".
Utilisateur is the keyprimary of the Systemuser entity.
How can i retrieve systemusers where the guid is IN my collection "colOwnersByPrd" ?
Many thanks for your help.
Solved! Go to Solution.
Note the error message gives a good indication.
How can i retrieve systemusers where the guid is IN my collection "colOwnersByPrd" - the answer is, you need to filter your collection where a FIELD in that collection has the guid value. Your code is saying "get me the records where this guid is in the RECORD". colOwnersByPrd.Result is a table of Records (users), so you should change your distinct to get you the distinct GUIDS where as right now you are getting the distinct USERS.
Note the error message gives a good indication.
How can i retrieve systemusers where the guid is IN my collection "colOwnersByPrd" - the answer is, you need to filter your collection where a FIELD in that collection has the guid value. Your code is saying "get me the records where this guid is in the RECORD". colOwnersByPrd.Result is a table of Records (users), so you should change your distinct to get you the distinct GUIDS where as right now you are getting the distinct USERS.
Hi @jd71 ,
Is the column in the red frame of the image the owner column?
If so, I assume the owner of your items are all users not teams and I did a test for you.
Add a button control and set its onselect property to:
ClearCollect(Col,ForAll(Distinct('TestL 17S',Owner),AsType(ThisRecord.Result,Users)))
// You can modify your formula according to my sample.
Now the specific user records in the user table is already in your collection.
You could use gallery or something other controls to get the values in this collction.
It should be noted that if you check the collection directly, you will find that it is all blank, but this does not affect to use it.
https://docs.microsoft.com/en-us/powerapps/maker/canvas-apps/functions/function-astype-istype
Best Regards,
Wearsky
I all.
Thanks for helping me.
Yesterday, i've finally resolved the problem by replacing "Utilisateur propriétaire" with "Utilisateur propriétaire".Utilisateur in the distinct criteria.
This training provides practical hands-on experience in creating Power Apps solutions in a full-day of instructor-led App creation workshop.
Come together to explore latest innovations in code and application development—and gain insights from experts from around the world.
User | Count |
---|---|
10 | |
9 | |
6 | |
4 | |
4 |
User | Count |
---|---|
37 | |
27 | |
21 | |
10 | |
6 |