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 / Condition to stop some...
Power Apps
Answered

Condition to stop someone from editing a record based on a value in another field

(0) ShareShare
ReportReport
Posted on by Microsoft Employee

I want to be able to stop people from editing a record via my app, if its 'Status' is Active or Completed.

For my Status column (plain text), I have four types; Pending, Available, Active and Completed.

I then have an 'Edit' button in my gallery that opens the selected record in the Form so that the user can modify existing details . But I want to limit this button to only open a record for modifying provided it's current status in Pending or Available.

 

Any help on the right way to structure the formula would be much appreciated. I am thinking at this stage that I should be able to do this with an If statement? So if the status equals x&y, open form in edit mode, otherwise...........

 

Categories:
I have the same question (0)
  • Verified answer
    mdevaney Profile Picture
    29,991 Moderator on at

    @Anonymous 

    You could enable/disable the button using this code in its DisplayMode property.

     

    If(Label_Status.Text in ["Pending","Available"] ,DisplayMode.Edit, DisplayMode.Disabled)

     

    Note: I am assuming the status is shown in a Label but you could reference it some other way if needed.

     

    ---
    Please click "Accept as Solution" if my post answered your question so that others may find it more quickly. If you found this post helpful consider giving it a "Thumbs Up."

     

  • Community Power Platform Member Profile Picture
    Microsoft Employee on at

    Thank  heaps - learning new things all the time. Didn't think to use the condition on a different property.

    Works perfectly.

  • lflemingcre Profile Picture
    2 on at

    Isn't this just 'Security through obscurity', and not actually secure? The user can edit this via the API or otherwise, meaning that your system/process is not secure and can easily be cracked by anyone, following a quick google search. 

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
WarrenBelz Profile Picture

WarrenBelz 427 Most Valuable Professional

#2
11manish Profile Picture

11manish 201 Super User 2026 Season 2

#3
MS.Ragavendar Profile Picture

MS.Ragavendar 128 Super User 2026 Season 2

Last 30 days Overall leaderboard