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 / Fx for If condition to...
Power Apps
Answered

Fx for If condition to display mode edit only else view

(0) ShareShare
ReportReport
Posted on by Microsoft Employee

Hi,

I'd like to make some fields to be set to Edit if the user is the person entered in the person field, manager field.

I can get this fx to work on the DisplayMode property if i hardcode the email but i want to make this work on a datacardvalue16 but cannot get it to work:

If (User().Email = "email", DisplayMode.Edit, DisplayMode.View)

Anyone know what the fx is to make another field display in edit mode only if the users name is in a previous field?

The DataCardValue16 field is a person field, with the data source SPO.

If I use the following i get red line under =

If (User().FullName = DataCardValue16, DisplayMode.Edit, DisplayMode.View)

Categories:
  • Community Power Platform Member Profile Picture
    Microsoft Employee on at

    Try this:

    If(User().FullName = DataCardValue16.Text, DisplayMode.Edit, DisplayMode.View)
  • Community Power Platform Member Profile Picture
    Microsoft Employee on at

     Hi Nope

     

    I get a red line under 

     

    = and under Text

  • Community Power Platform Member Profile Picture
    Microsoft Employee on at

    What about this?

    If(User().FullName = DataCardValue16.Email, DisplayMode.Edit, DisplayMode.View)

     

  • Community Power Platform Member Profile Picture
    Microsoft Employee on at

    Nope same issue now under = and Email

     

    normally when you type it pre-populates but when i type in Email, or Value or Text these do not

  • Community Power Platform Member Profile Picture
    Microsoft Employee on at

    Hmm.. try removing .Email in my example above and just add a dot after DataCardValue16 and see if any suggestions dropdown.

  • Community Power Platform Member Profile Picture
    Microsoft Employee on at

    Nope. cant get this fx to work, did not see any obvious ones from the drop down options to choose from, maybe the fx i'm using is wrong?

  • Verified answer
    Community Power Platform Member Profile Picture
    Microsoft Employee on at

    I was nearly there, figured it out and this works:

     

    If (User().Email in DataCardValue16.Selected.Email, DisplayMode.Edit, DisplayMode.View)

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 July Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Apps

#1
11manish Profile Picture

11manish 402 Super User 2026 Season 2

#2
Mohsin Ali Profile Picture

Mohsin Ali 328

#3
WarrenBelz Profile Picture

WarrenBelz 296 Most Valuable Professional

Last 30 days Overall leaderboard