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 / Disable A record and E...
Power Apps
Answered

Disable A record and Ensure user is not able to use it on the Form

(0) ShareShare
ReportReport
Posted on by 202

Hi All 

 

I have an issue  I need to resolve , In the App  I have an admin section where the Admin users go and perform maintenance for records captured on a form in this example I will use Accident group where there can add ,edit or disable these Accident groups .

 

They can be Animals ,Fatigue ,Hijacking etc .

 

  • Once  they select the disable button  achieved by Setting the Display Mode property of the field in my example Animal to :If(Checkbox 2. Value=true,Display Mode. Disabled,Display-mode. Edit)  which grays out that field.
  • This Accident group type  : Animal is used by users on a form  called  vehicle incidents and its is a drop down selection . 
    •  I would like once the Admin user has ticked the check box  for  this item to be greyed out it cannot be edited ,
    • On the form drop down it must  become greyed out  so that user can no longer use it  when they create new incidents 
    •  For previous incidents that it was used ,users can still enquire  the previous incidents  and see that field animal  because there reports that users pull for these incidents .

How can I achieve this ?, I have also added the attachments to show my screens . 

 

 

Accident Group Formula to disable the record on the admin screen.PNG

Disbaled item.PNG

Select the disabled and is now greyed out and can be edited 

 

 

Not greyed on the form and can be used 

Accident not greyed out on the dropdown.PNG

The Animal must remain on the enquiry of an incident captured before ..PNG
Disbaled item.PNG
Accident Group Formula to disable the record on the admin screen.PNG
Categories:
  • WarrenBelz Profile Picture
    156,566 Most Valuable Professional on at

    Hi @rmaziwis ,

    I do not believe you can disable/grey out a drop down / combo box item in the control itself, however there are a couple of approaches you could take.

    One would be to filter the drop-down list based on the criteria and simply not display it for choice.

    Another would be to trigger a notification to the user instead and reset the box.

    If you head this direction and want some assistance with the code, please let me know.

     

    If this post helps, then please consider Accept it as the solution to help the other members find it more. It also closes the item.

     

     

     

  • rodzmaz81 Profile Picture
    202 on at

    Hi 

     

    That is a tough one to work  because it is a requirement ,I will keep testing in the mean time .

  • rodzmaz81 Profile Picture
    202 on at

    Hi 

     

    Iam considering  trigger a notification to the user instead and reset the box option if we can go through that process i will be grateful 

  • WarrenBelz Profile Picture
    156,566 Most Valuable Professional on at

    OK @rmaziwis ,

    What is the trigger you would have used to disable the selection?

    I will write something generic so you can get the idea

    If(
     <Whatever the trigger is>,
     Notify("You cannot select this item", NotificationType.Error); //nice bright red message
     Reset(<dropdown name),
     <Whatever you would do if input valid>
    )

     

  • rodzmaz81 Profile Picture
    202 on at

    Hi 

     

    To disable a field am using  If(Checkbox2. Value=true,DisplayMode.Disabled,DisplayMode.Edit).

     

    If i understand you correctly in the visible property of the accident group drop down OR in the field for animal I have formula like below :

    If(Checkbox2.Value,Notify("You cannot select this item",NotificationType.Error);Reset(DataCardValue46);

     and Am not understanding the part ,sorry Iam just trying to get this right?

    <Whatever you would do if input valid>

     

  • WarrenBelz Profile Picture
    156,566 Most Valuable Professional on at

    @rmaziwis ,

    You don't need an "else" on an "if" statement unless there is one - I just put it there in case you did something else if the box value was valid so,

     

    If(
     Checkbox2.Value = true,
     Notify("You cannot select this item",NotificationType.Error);
     Reset(DataCardValue46)
    );

     

     would work as a formula, however what method do you use to determine what item selected in the drop down needs to be disabled? I am assuming the disabled checkbox is in a table containing the drop-down values and you want to check this table to see if the item should be disabled?

    I will ask you to confirm this however if this is the case, you need to do a lookup on that list for the value the user has chosen, then action the Notify if it is disabled. So - calling:-

    • the list Accidents
    • the field Accident Group
    • the drop-down is DataCardValue46 (as per your code)
    • the Checkbox field in Accidents NoShow

    On the OnChange property of the drop down

     

    If(
     Lookup(
     Accidents,
     'Accident Group' = DataCardValue46.Selected.'Accident Group',
     NoShow
     )
     = true,
     Notify("You cannot select this item",NotificationType.Error);
     Reset(DataCardValue46)
    )

     

    You need to substitute your field and control names for the above. If the name has no spaces, you do not need the quotes '.

    Also AccidentChoose.Selected.'Accident Group', may be something else depending on how you structured the drop down items

  • rodzmaz81 Profile Picture
    202 on at

    Hi 

     

    I really appreciate your a help and I am busy with this but just to answer you the table is called Accident group .

    The list is accident group(drop-down) and animal is from that list let me substitute and give you feedback if the logic works .

  • WarrenBelz Profile Picture
    156,566 Most Valuable Professional on at

    OK thanks @rmaziwis ,

    Please note timezone difference (I am in Australia), I look forward to the result of your efforts but may not get back to you until (my) morning.

     

  • Verified answer
    rodzmaz81 Profile Picture
    202 on at

    Hi 

     

    Iam still getting an error so iam not sure : 

     

    If(LookUp('[rp].[Accident group]',Accidentgroup =DataCardValue46.Selected.Name, Checkbox2 = true,Accidentgroup,Notify("You cannot select this item",NotificationType.Error);Reset(DataCardValue46)

    • my datasource is called rp.Accidentgroup 
    • the actual drop-down field is called accident group 
    • The dropdown is called datacardvalue46 on the form -
    • Iam ticking a checkbox in the admin screen called checkbox2 
    • The record iam disabling and is on the accident group list is called animal Error on this formula.PNGDisbaled item.PNG 

    The Accident group list.PNG

  • WarrenBelz Profile Picture
    156,566 Most Valuable Professional on at

    Hi @rmaziwis ,

    Sorry for the lateness of this reply.

    Firstly, I assume this code is on the OnChange property of the drop-down - also the issue here (now that I have my mind around what you are trying to do) is not the checkbox - it is the field name in the table that the checkbox sets to true. I will call it NotShow in the below - just substitute your field name for this.

    I also noticed you have said the field name in the drop-down is Accident Name - I may need a bit more clarification on this, however try this code.

    If(
     !isBlank(
     LookUp(
     '[rp].[Accident group]',
     Accidentgroup = DataCardValue46.Selected.'Accident Name' && NotShow.Value = true,
     AccidentGroup
     )
     ),
     Notify("You cannot select this item";
     NotificationType.Error);
     Reset(DataCardValue46)
    )

     

    Please click Accept as solution if my post helped you solve your issue. This will help others find it more readily. It also closes the item. If the content was useful in other ways, please consider giving it Thumbs Up.

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

Leaderboard > Power Apps

#1
11manish Profile Picture

11manish 383 Super User 2026 Season 2

#2
Mohsin Ali Profile Picture

Mohsin Ali 356

#3
WarrenBelz Profile Picture

WarrenBelz 232 Most Valuable Professional

Last 30 days Overall leaderboard