web
You’re offline. This is a read only version of the page.
close
Skip to main content

Notifications

Announcements

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

Forum hierarchy changes are complete!

In our never-ending quest to improve we are simplifying the forum hierarchy…

Ajay Kumar Gannamaneni – Community Spotlight

We are honored to recognize Ajay Kumar Gannamaneni as our Community Spotlight for December…

Leaderboard > Power Apps

#1
WarrenBelz Profile Picture

WarrenBelz 721 Most Valuable Professional

#2
Michael E. Gernaey Profile Picture

Michael E. Gernaey 320 Super User 2025 Season 2

#3
Power Platform 1919 Profile Picture

Power Platform 1919 268

Last 30 days Overall leaderboard