Good morning Power Apps Community,
I would love some help to resolve an obstacle in my build.
In my form I have a field that relies on another field. Both of which are dropdowns. I'm trying to lock the first field to say "XYZ" and not show other options. However this has proved rather difficult.
In my app I have
1. A gallery only showing items that are affected by "XYZ"
2. A Form that toggles to NewForm & EditForm
In the Editform mode, the field shows "XYZ" because it's showing data already in the gallery. However with NewForm it's left blank so I can not use view mode on the data card.
One method of partially tackling this would maybe be to use display forms to only allow editing in when newform, and leave it as view only when in Editform. Is this possible?
Code I have so far, which is not working:
If(NewForm(Gallery_ABC) ,DisplayMode.Edit,DisplayMode.View)
Any solutions to this problem would be amazing! Thank you so much for your time 😄
Hi @PowerAppsRookie,
Do you want to make the data card read-only in new mode?
Could you please share a bit more about your scenario?
Actually, you could set the Default or DefaultSelectedItems property of the dropdown control as below:
If(Form2.Mode=FormMode.New,["XYZ"],ThisItem.'Record Type')
Set the DisplayMode property of the data card as below:
If(Form2.Mode=FormMode.New,Disabled,Parent.DisplayMode)
Yes, exactly this
are you saying if it s a new form, set the field value to "XYZ" and disable to control so that users cant change the value any more?
Thank you
-Srikanth
WarrenBelz
637
Most Valuable Professional
stampcoin
570
Super User 2025 Season 2
Power Apps 1919
473