Skip to main content

Notifications

Community site session details

Community site session details

Session Id :
Power Apps - Building Power Apps
Answered

Trying to disable all fields using Form DisplayMode

(0) ShareShare
ReportReport
Posted on by 289

Hi Guys,

When a user recalls one of their requests and the status is "To be submitted", I would like to allow them to edit any field. If the status is anything else I would like to disable all fields.

In the form DefaultMode property, I have put:

If(varStatus="To be submitted",FormMode.Edit,FormMode.View)

When I change this while the form is open the fields disable as expected, but as soon as I go back and navigate to the form again all of the fields are editable.

The DisplayMode property of all of my fields is Parent.DisplayMode

What am I doing wrong?

Categories:
  • JimJim Profile Picture
    289 on at
    Re: Trying to disable all fields using Form DisplayMode

    Thank you so much 😀

  • StalinPonnusamy Profile Picture
    Super User 2024 Season 1 on at
    Re: Trying to disable all fields using Form DisplayMode

    StalinPonnusamy_0-1631285544094.png

     

  • Verified answer
    StalinPonnusamy Profile Picture
    Super User 2024 Season 1 on at
    Re: Trying to disable all fields using Form DisplayMode

    Hi @JimJim 

     

    Set the OnSelect property of gallery to

    If(
     ThisItem.Status.Value = "To Be Submitted",
     EditForm(EditForm1),
     ViewForm(EditForm1)
    );
    Navigate(
     EditScreen1,
     ScreenTransition.None
    )

     

  • JimJim Profile Picture
    289 on at
    Re: Trying to disable all fields using Form DisplayMode

    When a user selects an item in a gallery, the following code assigns a value to the variable

    Set(varStatus,LookUp('Requests', ID = gal_ViewRequests.Selected.ID).Status)

    I have shown the value of varStatus in a label and it look fine

  • zmansuri Profile Picture
    6,048 Super User 2024 Season 1 on at
    Re: Trying to disable all fields using Form DisplayMode

    Your default mode code looks ok. Show all the code related to varStatus

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

🌸 Community Spring Festival 2025 Challenge 🌸

WIN Power Platform Community Conference 2025 tickets!

Markus Franz – Community Spotlight

We are honored to recognize Markus Franz as our April 2025 Community…

Kudos to the March Top 10 Community Stars!

Thanks for all your good work in the Community!

Leaderboard

#1
WarrenBelz Profile Picture

WarrenBelz 146,609 Most Valuable Professional

#2
RandyHayes Profile Picture

RandyHayes 76,287 Super User 2024 Season 1

#3
Pstork1 Profile Picture

Pstork1 65,946 Most Valuable Professional

Leaderboard