web
You’re offline. This is a read only version of the page.
close
Skip to main content

Notifications

Announcements

Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Apps / How to make a Form Dat...
Power Apps
Answered

How to make a Form Data Card edit only when in NewForm, and view when in EditForm

(0) ShareShare
ReportReport
Posted on by 87

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 😄

Categories:
I have the same question (0)
  • ansrikanth Profile Picture
    329 on at

    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

  • PowerAppsRookie Profile Picture
    87 on at

    Yes, exactly this

  • Verified answer
    v-qiaqi@microsoft.com Profile Picture
    on at

    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)

    vqiaqimsft_0-1647594789277.png

     

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

Forum hierarchy changes are complete!

In our never-ending quest to improve we are simplifying the forum hierarchy…

Ajay Kumar Gannamaneni – Community Spotlight

We are honored to recognize Ajay Kumar Gannamaneni as our Community Spotlight for December…

Leaderboard > Power Apps

#1
WarrenBelz Profile Picture

WarrenBelz 711 Most Valuable Professional

#2
Michael E. Gernaey Profile Picture

Michael E. Gernaey 319 Super User 2025 Season 2

#3
Power Platform 1919 Profile Picture

Power Platform 1919 268

Last 30 days Overall leaderboard