web
You’re offline. This is a read only version of the page.
close
Skip to main content

Announcements

News and Announcements icon
Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Apps / Cannot compare a guid ...
Power Apps
Answered

Cannot compare a guid value with a collection of records

(1) ShareShare
ReportReport
Posted on by

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 : 

jd71_1-1640199985011.png

 

Here's the filter code : 

jd71_0-1640199809601.png

 

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.

 

 

I have the same question (0)
  • Verified answer
    dave-jorgensen Profile Picture
    502 on at

    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.

  • v-xiaochen-msft Profile Picture
    Microsoft Employee on at

    Hi @jd71 ,

     

    Is the column in the red frame of the image the owner column?

    vxiaochenmsft_0-1640228168480.png

     

    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.

    vxiaochenmsft_1-1640228617302.png

    vxiaochenmsft_2-1640228624700.png

     

    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.

    vxiaochenmsft_3-1640228701137.png

     

    https://docs.microsoft.com/en-us/powerapps/maker/canvas-apps/functions/function-astype-istype 

     

    Best Regards,

    Wearsky

     

     

     

  • jd71 Profile Picture
    on at

    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. 

     

     

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Introducing the 2026 Season 1 community Super Users

Congratulations to our 2026 Super Users!

Kudos to our 2025 Community Spotlight Honorees

Congratulations to our 2025 community superstars!

Leaderboard > Power Apps

#1
WarrenBelz Profile Picture

WarrenBelz 525 Most Valuable Professional

#2
Haque Profile Picture

Haque 273

#3
Kalathiya Profile Picture

Kalathiya 232 Super User 2026 Season 1

Last 30 days Overall leaderboard