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 / Lock a default value f...
Power Apps
Answered

Lock a default value for a data card (choice field) in a form connected to Sharepoint list

(0) ShareShare
ReportReport
Posted on by Microsoft Employee

I have a PowerApp with an edit form linked to SharePoint. I hardcoded a default value in one of the data cards. I want to lock this default value so the user of the powerapp cannot change it. I tried setting visble = false but that gave an error to users when they sumbitted the form.

 

Just in case it matters the datacard is a choice field and I had to do a work around to get the default value. I used the two formulas below on the screen and datacard. 

Screen:

OnStart = Set(var_default,"Template Update")

DataCard:

Default = {Value: var_default}

 

Categories:
I have the same question (0)
  • Verified answer
    TimRohr Profile Picture
    669 on at

    Have you tried setting the Display Mode property to DisplayMode.Disabled?

  • iAm_ManCat Profile Picture
    18,256 Most Valuable Professional on at

    There's an easy workaround for this - leave your choice field as normal once its working and getting the correct default, then create a blank label, put it on top of what you're trying to stop the user from touching. Then make sure to set whatever it is you're blocking them from (in this case choice field) to have an index of -1 so that they can't Tab into the field.

     

    As an Added bonus, I like to set the borders and chevron and etc to blank RGBA(0,0,0,0) as well for field boxes so it just looks like it's being stated instead of them thinking they can change it:
    image.png

    I've attached the Proof of Concept app,

     

    Cheers,

    @iAm_ManCat

  • v-xida-msft Profile Picture
    Microsoft Employee on at

    Hi @kywest,

    Could you please share a bit more about your scenario?

    Do you not want the user to change the Default value within the Choice field or edit the Choice field itself within your Edit form?

    If you don't want the user to change the Choice field itself within your Edit form, I agree with @TimRohr's thought almost. I think the DisplayMode property of the Combo Box could achieve your needs. Please take a try to set the DisplayMode property of the Combo Box control within the Choice field Data card to following:

    DisplayMode.Disabled

    If you don't want the users to change the Default value of the Combo Box within the Choice field Data card, you just need to share the end users with User permission rather than Co-Owner permission. The user who has User Permission to your app could only use your app, could not edit your app, so they could not change the Default value of the Combo Box control within the Choice field Data card.

     

    Best regards,

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 505

#2
WarrenBelz Profile Picture

WarrenBelz 502 Most Valuable Professional

#3
Haque Profile Picture

Haque 324

Last 30 days Overall leaderboard