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 / Block a field based on...
Power Apps
Unanswered

Block a field based on another field value on model driven app

(0) ShareShare
ReportReport
Posted on by 67

Dear community,

 

I am looking for a way to block a field based on another field value (condition), I am building a model-driven app. I was thinking of creating field security profiles, but I cannot find a way to automatically assign those profiles based on another field value.

 

E.G: If the account balance is greater than 500$ then the application status field is set to block for that particular user/team.

 

Any suggestion?

 

I really appreciate any help you can provide.

 

Jose G Diaz

Categories:
I have the same question (0)
  • Ethan_009 Profile Picture
    4,838 Moderator on at

    Hi @josegdiazv ,

     

    Well, there are few methods and I'd suggest 2 of them.

    Method 1: JS style (will only work on front-end when user opens the record) [Note: It won't work if user makes changes to record from elsewhere]

    Step 1: Create a security role just an identification purpose and assign it to the Users.

    Step 2: Create a JS on the Form that will run OnLoad and will validate the 'account balance is greater than 500$' and also check security roles assigned to current logged in User.

    Step 3: If the validation is true, then lock the field so user cannot make changes. Else keep open to edit.

     

    Method 2: Use of Plugins (this will work even in backend)

    Step 1: Create security role just like Method 1.

    Step 2: Whenever any user makes changes on the Form. Before the updates are saved, fire the plugin to validate the updated record's 'account balance is greater than 500$' and triggered user's role contains the new security role.

    Step 3: If your plugin detects the values + updates made on the Field you don't want it to be updated. Then simply throw error defining that user cannot update this record.

     

    Hope this helps

  • Jose Gregorio Diaz Profile Picture
    67 on at

    Thank you a lot Ethan, this part will be a bit new for me, it seems that there is not a out of the box way to do it in this case, Do you have good relevant documentation to share with me so I can start getting knowledge about how to do it?

  • Ethan_009 Profile Picture
    4,838 Moderator on at

    Hi @josegdiazv ,

     

    Out-of-the-box you have field security profiles. 

    To manage it, I'd suggest create a new Group and add relevant users in them. 

    Then assign Field level security profiles for that field with the group you created (not users individually)

    You need to add users in the Group so the rules will apply directly.

     

    JS Documentation

    Below you will find Client API references as well which will be handy for you.

     

    Plugin Documentation

     

    Hope this helps

  • Linn Zaw Win Profile Picture
    2,996 on at

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 326 Most Valuable Professional

#2
11manish Profile Picture

11manish 168

#3
sannavajjala87 Profile Picture

sannavajjala87 75 Super User 2026 Season 1

Last 30 days Overall leaderboard