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 / Set the Display mode t...
Power Apps
Answered

Set the Display mode to View or Edit

(0) ShareShare
ReportReport
Posted on by 381

Hello. 

 

I have an edit form reading from a SPO list. 

 

I have a column called Owner and a choice column called Status and a few other columns too. 

 

I need it so that only the Owner can change the Status. If a non-owner opens the edit form for that item, then they should receive an error message if they try to edit any of the columns.  I beleive i can get the person who is loading the form via the

 User().Email ?

 

I tried to do something like the below on the status datacard, but no luck

 

If(Owner.text = user().email, set(displayMode.Edit) else set(displayMode.View)  That line of code didnt work - but i hope you get the jist of what i am trying to do, also, how can i add a warning if a non owner tried to edit?

 

Can someone help me pleasE?

 

thanks. 

Categories:
I have the same question (0)
  • eka24 Profile Picture
    20,923 on at

    What values do you have in the Status column, emails?

    If possible show a screen shot of the sample data

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

    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.

    Please Subscribe to my Youtube Channel

     

  • Verified answer
    Vstar19 Profile Picture
    381 on at

    Hello. 

    I have got this to work via the code below

     

    If(
    Lower(DataCardValue4_1.Selected.Email) = Lower(User().Email),
    DisplayMode.Edit,
    DisplayMode.Disabled
    )

     

    What i need now is to say, if the Data Mode is disabled, i need a warning message to say "This field is disabled because you are now the owner) . How can that be acheived?

  • eka24 Profile Picture
    20,923 on at

    Try this:

    If(
    Lower(DataCardValue4_1.Selected.Email) = Lower(User().Email),
    DisplayMode.Edit,
    DisplayMode.Disabled
    );Notify("This field is disabled")

    Not sure where the code is located but your Notify function will work.

     

    Notify function in Power Apps - Power Apps | Microsoft Docs

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

    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.

    Please Subscribe to my Youtube Channel

     

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 530

#2
WarrenBelz Profile Picture

WarrenBelz 459 Most Valuable Professional

#3
Haque Profile Picture

Haque 314

Last 30 days Overall leaderboard