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 / Filter Gallery if user...
Power Apps
Unanswered

Filter Gallery if userID belongs to a column in a collection

(0) ShareShare
ReportReport
Posted on by 407

Hi all,

I have a collection that contains a single line of text column with multiple user ID's separated by a semi-colon. (sample below)

 

multiple users.png

I need to get their user profile in order to get their email address. How can I pull this data from the collection or in the gallery using the Office365Users Connector? or if there's another way to accomplish this I would love to know.

 

I need to filter the gallery if the current user ID is in one of these.

 

Thanks

Categories:
I have the same question (0)
  • WarrenBelz Profile Picture
    154,928 Most Valuable Professional on at

    Hi @_sourcecod3_ ,

    Using the text you posted

    ForAll(
     Split(
     YourString,
     ";"
     ) As _Mail,
     Office365Users.UserProfileV2(_Mail.Value).mail
    )

     

    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.

    MVP (Business Applications)   Visit my blog Practical Power Apps

  • _sourcecod3_ Profile Picture
    407 on at

    Hi @WarrenBelz will this go in the field value inside the gallery itself? 

  • WarrenBelz Profile Picture
    154,928 Most Valuable Professional on at

    Hi @_sourcecod3_ ,

    That code will produce a Table with the email addresses. If you want them back into a delimited String in the Gallery

    Concat(
     ForAll(
     Split(
     YourString,
     ";"
     ) As _Mail,
     Office365Users.UserProfileV2(_Mail.Value).mail
     ),
     Value,
     ";"
    )

     

    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.

    MVP (Business Applications)   Visit my blog Practical Power Apps

     

  • _sourcecod3_ Profile Picture
    407 on at

    Hi @WarrenBelz,

     

    For some reason it's saying the resource is not found. I'm replacing the 'YourString' value with the value inside the gallery. 'Thisitem.UserIDs'

     

    This is the error message I'm getting: 

     

    Resource Not Found.png

     

    Any ideas how to fix this?

     

    Thanks in advance

  • WarrenBelz Profile Picture
    154,928 Most Valuable Professional on at

    @_sourcecod3_ ,

    You probably need an error trap, but I do not think that is the issue. Have you added Office365Users to your Data Sources ?

    IfError(
     Concat(
     ForAll(
     Split(
     ThisItem.YourStringField,
     ";"
     ) As _Mail,
     Office365Users.UserProfileV2(_Mail.Value).mail
     ),
     Value,
     ";"
     ),
     ""
    )

     

    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.

    MVP (Business Applications)   Visit my blog Practical Power Apps

     

  • _sourcecod3_ Profile Picture
    407 on at

    Hi @WarrenBelz , After changing the code to the one you provided, it just removed all the User IDs from the gallery, but no errors. I do have the Office365 connector added to the app as well as I'm using it on other areas of within the app.

  • WarrenBelz Profile Picture
    154,928 Most Valuable Professional on at

    Hi @_sourcecod3_   ,

    I am not sure that you mean - If that was a Label in the Gallery and your string was in a field in the gallery data source, it should convert the Id numbers to email addresses - attached is a test I did here using my Id twice in the list field and then the formula I got my email address twice separated by ;

    SplitMail.png

     

    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.

    MVP (Business Applications)   Visit my blog Practical Power Apps

  • _sourcecod3_ Profile Picture
    407 on at

    hi @WarrenBelz yeah it is a label in a gallery, The label contains multiple userIDs separated by a semi-colon, would that be the issue? 

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!

Congratulations to the March Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Apps

#1
11manish Profile Picture

11manish 551

#2
WarrenBelz Profile Picture

WarrenBelz 430 Most Valuable Professional

#3
Valantis Profile Picture

Valantis 298

Last 30 days Overall leaderboard