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 / Help please on form di...
Power Apps
Answered

Help please on form display mode?

(1) ShareShare
ReportReport
Posted on by 84
Hi There,
 
In PowerApps, I have a screen with a Tab List, Table and a Form. My tabs consist of the Approval Status (Approved, Declined and Pending). What I'm trying to achieve is, when I click on the Approved or Declined tab then click on an item in the table, I would like the form to show as read-only. If it's the Pending tab then the form should be on Edit mode.
 
I have written the code below, thinking that it's correct because it's not giving any errors but any tab I clicked on, just opens in Edit mode.
 
ResetForm(Form2_1);
If(
    TabList1.Selected.Value = "Pending",
    varFormmode = FormMode.Edit,
    varFormmode = FormMode.View
);
Set(
    varShowForm,
    true
);
 
Any suggestions please?
Categories:
I have the same question (0)
  • Verified answer
    WarrenBelz Profile Picture
    153,084 Most Valuable Professional on at
    The issue is that setting a Variable (which I assume you are applying the the Default Mode) does not trigger a form mode change. You are better setting the DisplayMode of a Data Card
    If(
        TabList1.Selected.Value = "Pending" && YourFormName.Mode <> FormMode.View,
        DisplayMode.Edit,
        DisplayMode.View,
    );
    then set the other Data Card's DisplayMode to
    YourFirstDataCardName.DisplayMode
    Please click Does this answer your question if my post helped you solve your issue. This will help others find it more readily. It also closes the item. If the content was useful in other ways, please consider giving it a Like.
    MVP (Business Applications)     Visit my blog Practical Power Apps    Buy me a coffee
  • CU16101721-1 Profile Picture
    84 on at
    Hi Warren, thank you for the response.
     
    Applying to the Data Card will not work because I want the whole form to be View only if Tab List <> Pending.
     
    In my scenario, the user clicks on a Tab (Approved, Declined, Pending) then the Table will populate the list of items. From there, the user can click on any of the item and a form pops out.
     
    I tried to apply my code to the OnSelect property of the Table.
     
    I hope I explained it better this time, so sorry for the confusion.
     
    Thanks again,
    MT
  • pandas Profile Picture
    2 on at
    Hello, 
    I have a similar situation I am working on now. You should be able to achieve this by setting a variable when you click on the tabs. Set the OnSelect property of each button to set a value to a variable. For the 2 that are read only, set your variable to false and then set it to true for the one that should go into edit mode. For the DefaultMode property of your form, add a condition something like:
     
    If(myvariable=true,FormMode.Edit,FormMode.View)
  • Verified answer
    Nirav Raval (Akira28) Profile Picture
    153 Moderator on at
    Hi  ,

    Can you try the below code, hope it works 🤞

    Add on the form property > Mode 

    If(
        TabList1.Selected.Value = "Pending",
        FormMode.Edit,
        FormMode.View
    )



    If this post solved your issue, clicking 'Does this answer your question' will help others discover the solution and close the topic. If you found it helpful, a Like would be awesome!

    Regards,
    Nirav J Raval (Akira28)
  • CU16101721-1 Profile Picture
    84 on at
    Thank you so much, Nirav! Your solution worked :)

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 739 Most Valuable Professional

#2
Michael E. Gernaey Profile Picture

Michael E. Gernaey 343 Super User 2025 Season 2

#3
Power Platform 1919 Profile Picture

Power Platform 1919 268

Last 30 days Overall leaderboard