cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
kywest
Helper I
Helper I

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

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}

 

1 ACCEPTED SOLUTION

Accepted Solutions
TimRohr
Solution Sage
Solution Sage

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

View solution in original post

3 REPLIES 3
TimRohr
Solution Sage
Solution Sage

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

View solution in original post

iAm_ManCat
Super User
Super User

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

@iAm_ManCat


Please 'Mark as Solution' if someone's post answered your question and always 'Thumbs Up' the posts you like or that helped you!


Thanks!
You and everyone else in the community make it the awesome and welcoming place it is, keep your questions coming and make sure to 'like' anything that makes you 'Appy
Sancho Harker, MVP


v-xida-msft
Community Support
Community Support

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,

Community Support Team _ Kris Dai
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Helpful resources

Announcements
UG GA Amplification 768x460.png

Launching new user group features

Learn how to create your own user groups today!

Community Connections 768x460.jpg

Community & How To Videos

Check out the new Power Platform Community Connections gallery!

Welcome Super Users.jpg

Super User Season 2

Congratulations, the new Super User Season 2 for 2021 has started!

Carousel 2021 Release Wave 2 Plan 768x460.jpg

2021 Release Wave 2 Plan

Power Platform release plan for the 2021 release wave 2 describes all new features releasing from October 2021 through March 2022.

Users online (1,320)