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 / Issue with comparison ...
Power Apps
Answered

Issue with comparison user value

(0) ShareShare
ReportReport
Posted on by 10

I have a SharePoint table which has a column posted by (data type people). And my app has a email address variable.

I want to set a condition on a button that if the email variable is in the posted by column navigate to page 1 otherwise navigate to page 2,

Can anyone please help me with this I am new to power app and learning through small app of my own

Categories:
I have the same question (0)
  • Verified answer
    madlad Profile Picture
    2,637 Moderator on at

    You should be able to do something along the lines of:

     

    If(
     *EmailVariable* in AddColumns(*YourList*, "Emails", *PostedByColumn*.Email).Emails,
     Navigate(*Page 1*), 
     Navigate(*Page 2*)
    )

     

    Just make sure to sub in the appropriate names where I've surrounded with Asterisks*, based on your data.

     

    Hope this helps!

  • BCBuizer Profile Picture
    22,833 Super User 2026 Season 1 on at

    Hi @Shreya308 ,

     

    Set the OnSelect property of the button to:

    Navigate(
     If(
     varEmail in ThisItem.'posted by'.Email,
     Page1,
     Page2
     )
    )

     

    This works under the assumption the button is inside a gallery and the 'posted by' column has multi-select enabled. If any of these assumptions are wrong, please provide the relevant details.

     

  • stuermer Profile Picture
    64 on at

    Hey! To achieve that you can use the OnSelect property in combination with an "if-statement". How you are displaying the data from SharePoint? In a Gallery? If so, you can try something like this:

     

    If the button is part of your Gallery item: If(yourEmailVariable = ThisItem.'Posted By'.Email, Navigate(Page1), Navigate(Page2))

     

    If the button is not part of your Gallery: If(yourEmailVariable = YourGalleryName.Selected.'Posted By'.Email, Navigate(Page1), Navigate(Page2))

     

    Instead of using a variable for the email you could also user user().email to get the currents user's mail address.

     

    Let me know if this helps you.

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

Congratulations to the June Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Apps

#1
WarrenBelz Profile Picture

WarrenBelz 342 Most Valuable Professional

#2
11manish Profile Picture

11manish 234

#3
Valantis Profile Picture

Valantis 187

Last 30 days Overall leaderboard