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 / Using "contains" insid...
Power Apps
Unanswered

Using "contains" inside powerapps

(0) ShareShare
ReportReport
Posted on by 287

I have a gallery in one of my screen where i would like show filtered items from a sharepoint list and the filter condition is that a column in the list (PersonEmail) contains User().Email 

I would like to show these records to the user

Please let me know how can i achieve this ?

Categories:
  • eka24 Profile Picture
    20,925 on at

    Use

    Filter (YourDatasource,PersonalEmail=User().Email)

    ------------

    If you like this post, give a Thumbs up. Where it solved your request, Mark it as a Solution to enable other users find it.

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

    Hi @vish_p :

    Could you tell me:

    • What is PersonEmail's date type?Text?Person?Choices?
    • If it is of type text, is its value a string of mailbox type? Or a string of multiple email addresses?
    • If he is a Choice type, does it allow multiple selections?

    Because I don’t know the specific situation, there are two examples:

    Case 1:Text type/a string of multiple email addresses

    try this code:

     

    Filter(yourdatasource,User().Email exactin PersonEmail)

     

    Case 2:Choice type/allow multiple selections.

     

    Filter(yourdatasource,User().Email in PersonEmail.Value)

     

    I think this link will help you a lot:

    https://docs.microsoft.com/en-us/powerapps/maker/canvas-apps/functions/operators

    Best Regards,

    Bof

  • vish_p Profile Picture
    287 on at

    @v-bofeng-msft  PersonEmail is  choice field where multiple selection is allowed thats why i wanted to use contains,i tried using "in"  operator but it is not giving desired result

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

    Hi @vish_p :

    Did this code fail?(Filter(yourdatasource,User().Email in PersonEmail.Value))

    What is the error?

    Could you give me a screenshot of the code area?

    Best Regards,

    Bof

  • eka24 Profile Picture
    20,925 on at

    Use

    Filter (YourDatasource,PersonalEmail.Value=User().Email)

     

    Or

    Filter (YourDatasource,User().Email in PersonalEmail.Value)

    ------------

    If you like this post, give a Thumbs up. Where it solved your request, Mark it as a Solution to enable other users find it.

  • vish_p Profile Picture
    287 on at

    @eka24 @v-bofeng-msft 

     

    I tried both, for one formula(Filter(TODOLIST,User().Email = PersonEmail)) i am getting an "Invalid argument type"error and the other one(Filter(TODOLIST,User().Email in PersonEmail)) doesn't filter data at all

     

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

    Hi @vish_p :

    Have you tried PersonEmail.Value instead of PersonEmail?

    Best Regards,

    Bof

  • vish_p Profile Picture
    287 on at

    @v-bofeng-msft Yes tried that as well, it is not returning any data 

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

    Hi @vish_p :

    Could you show me a screenshot of the code area?Usually the wrong place will be marked.

    In addition,using in PersonEmail.Value instead of = PersonEmail.Value

    Best Regards,

    Bof

  • vish_p Profile Picture
    287 on at

    @v-bofeng-msft  for some reason i am not able to upload any photo here

    but When i use "Filter(TODOLIST,User().Email in PersonEmail.Value)" no error is shown and no items are returned
    when i use "Filter(TODOLIST,User().Email = PersonEmail.Value)" invalid argument type error is shown at equal to symbol

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

Season of Sharing Community Challenge Winners!

Congratulations to our community stars!

Kudos to our 2025 Community Spotlight Honorees

Expanding mentorship, skilling, and AI innovation

Leaderboard > Power Apps

#1
11manish Profile Picture

11manish 236 Super User 2026 Season 2

#2
WarrenBelz Profile Picture

WarrenBelz 207 Most Valuable Professional

#3
Mohsin Ali Profile Picture

Mohsin Ali 169

Last 30 days Overall leaderboard