cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
xinyue
Frequent Visitor

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 Resolver II
Resolver II

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 Helper II
Helper II

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 Resolver II
Resolver II

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
Frequent Visitor

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 Resolver II
Resolver II

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
MBAS Gallery 2020

MBAS Gallery 2020

Watch Microsoft Business Applications Summit sessions on-demand.

firstImage

New Ranks and Rank Icons released on April 21!

The time has come: We are finally able to share more details on the brand-new ranks coming to the Power Apps Community!

Top Solution Authors
Top Kudoed Authors
Users online (7,065)