cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
xinyue
Level: Powered On

PowerAppa Form- Hide fields while in approval

hi,

I have a powerapp form. It's an application form. Except fileds imported from sharepoint online list, I also add a checkbox and a submit button. When an applicant submit the form, an approval will start.

Now, when approver open the item link,  the checkbox and the button can still be edited, and the checkbox value=false though applicant has checked the box. So is there any solution to this problem?

And I also want to hide the submit button while the approver open the item link ,is it possible ?

 

Thank you!

1 ACCEPTED SOLUTION

Accepted Solutions
QJappie22
Level 8

Re: PowerAppa Form- Hide fields while in approval

Hey @xinyue ,

 

Exactly like @NP1 says. Make sure you have a column in SharePoint with the name Status and you can either choose to make this a dropdown column with for example the options 'new', 'under approval', 'approved' and 'not approved' (recommended), or a Text column which u can fill manually. Your approval can be started with Flow and before the step 'Start and wait for an approval' is executed u can add a step that changes the status. As @NP1 mentioned you can use the Displaymode option of the Button and the checkbox to add a code like:

 

If(Status.Value = "under approval", Disabled, Edit)

Or if you don't want the Button to be visible add this code to the Visible option:
Status.Value <> "under approval"

View solution in original post

4 REPLIES 4
NP1
Level: Powered On

Re: PowerAppa Form- Hide fields while in approval

Is there a field in your sharepoint that stores the status? If so, you could use the "DisplayMode" value of the button, the code would look something like this. 

 

If(Status = "Under Approval", DisplayMode.Disabled, DisplayMode.Edit)
QJappie22
Level 8

Re: PowerAppa Form- Hide fields while in approval

Hey @xinyue ,

 

Exactly like @NP1 says. Make sure you have a column in SharePoint with the name Status and you can either choose to make this a dropdown column with for example the options 'new', 'under approval', 'approved' and 'not approved' (recommended), or a Text column which u can fill manually. Your approval can be started with Flow and before the step 'Start and wait for an approval' is executed u can add a step that changes the status. As @NP1 mentioned you can use the Displaymode option of the Button and the checkbox to add a code like:

 

If(Status.Value = "under approval", Disabled, Edit)

Or if you don't want the Button to be visible add this code to the Visible option:
Status.Value <> "under approval"

View solution in original post

xinyue
Level: Powered On

Re: PowerAppa Form- Hide fields while in approval

I just create that column, but I don't know where to add the code.  When I edit the Displaymode of the submit button,it doesn't show "Status" or other relevant choices. When I change "Status" into datacardvalue.selected.value, it also goes wrong. Canyou tell me how to write the code?

Thx!

QJappie22
Level 8

Re: PowerAppa Form- Hide fields while in approval

Are the Checkbox and the Submit Button inside of the Form you're using? If so, you can use:

 

ThisItem.Status.Value


If the controls are outside of the Form you can place them inside by adding a Custom Card to your Form and placing the control inside that DataCard. Then you'll be able to use the above code.

 

If you are still not able to see Status, try to refresh the DataSource in the PowerApp by clicking View->Data sources->three dots of the source->Refresh.

 

I hope this will help you 🙂

 

 

Helpful resources

Announcements
thirdimage

Power Automate Community User Group Member Badge

Fill out a quick form to claim your user group badge now!

sixthImage

Power Platform World Tour

Find out where you can attend!

Power Platform 2019 release wave 2 plan

Power Platform 2019 release wave 2 plan

Features releasing from October 2019 through March 2020

fifthimage

Microsoft Learn

Learn how to build the business apps that you need.

Top Kudoed Authors (Last 30 Days)
Users online (4,994)