cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
Anonymous
Not applicable

Custom Forms OnVisible Not Working?

Hello Everyone,

 

I have a custom form on Powerapps that i'm using for approvals on SharePoint. The function that I want: is for the form to remain editable by users in order for them to be able to submit items. Then that item is chosen for approval, and I no longer want the datacards to be editable by the approver

 

Therefore, I've set a variable named "submittedFlag" and the app sets submittedFlag to DisplayMode.View or DisplayMode.Edit on the following IF Statement: If(IsBlank(ID Number of Item), Set(submittedFlag, DisplayMode.Edit), Set(submittedFlag, DisplayMode.View)

 

I've put the submittedFlag variable inside the "OnVisible" property of the screen where the form lives. Everything works fine if I manually navigate from another screen to the form screen but the On Visible for the screen doesnt work if you copy and paste the link into the URL and navigate to the app that way. 

 

Any work arounds or words of advice?

 

P.S. I need the custom form to stay in edit mode, even on view by the approvers (the reason for that being is because, when the approvers hit the "Approve" button, I submit the form, again (instead of Patching it) because I want to trigger a Flow to send out emails, but the flow isn't triggered with the patch function (I believe it's a bug).

5 REPLIES 5
Highlighted
Super User
Super User

Re: Custom Forms OnVisible Not Working?

Is this a standalone PowerApp using SharePoint as a data source or a PowerApps custom SharePoint list form?



--------------------------------------------------------------------------------
If this post helps answer your question, please click on “Accept as Solution” to help other members find it more quickly. If you thought this post was helpful, please give it a Thumbs Up.
Highlighted
Anonymous
Not applicable

Re: Custom Forms OnVisible Not Working?

Hi Jeff,

Thanks for the response, this is a PowerApps custom SharePoint list form
Highlighted
Super User
Super User

Re: Custom Forms OnVisible Not Working?

Try adding Navigate to the SharePointIntergration Actions OnNew, OnEdit, and OnView. I think that will tickle the OnVisible and get it to fire.

 

Example:

'The existingfFormula'; Navigate(FormScreen1,None)



--------------------------------------------------------------------------------
If this post helps answer your question, please click on “Accept as Solution” to help other members find it more quickly. If you thought this post was helpful, please give it a Thumbs Up.
Highlighted
Community Support
Community Support

Re: Custom Forms OnVisible Not Working?

HI @Anonymous ,

Based on the issue that you mentioned, I think you have some misunderstanding on the OnVisible property of custom form screen within SP list.

Actually, there are some limits on the OnVisible property of the custom form screen. Please check the following article:

https://docs.microsoft.com/en-us/powerapps/maker/canvas-apps/sharepoint-form-integration#customize-the-default-form

 

As an alternative solution, please consider put your If formula within the OnNew, OnEdit or OnView property of the SharePointIntegration control.

 Set the OnNew property of the SharePointIntegration control to following:

If(
IsBlank(SharePointIntegration.SelectedListItemID), /* <-- Or type SharePointIntegration.Selected.ID */
Set(submittedFlag, DisplayMode.Edit),
Set(submittedFlag, DisplayMode.View
);
NewForm(SharePointForm1) /* <-- SharePoitForm1 represents the Edit form in your custom form app */

 Set the OnEdit property of the SharePointIntegration control to following:

If(
IsBlank(SharePointIntegration.SelectedListItemID),
Set(submittedFlag, DisplayMode.Edit),
Set(submittedFlag, DisplayMode.View
);
EditForm(SharePointForm1)

 Set the OnView property of the SharePointIntegration control to following:

If(
IsBlank(SharePointIntegration.SelectedListItemID),
Set(submittedFlag, DisplayMode.Edit),
Set(submittedFlag, DisplayMode.View
);
ViewForm(SharePointForm1)

 

Please consider take a try with above solution, then check if the issue is solved.

 

Best regards,

Community Support Team _ Kris Dai
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Highlighted
Regular Visitor

Re: Custom Forms OnVisible Not Working?

Thanks a lot fo this suggestion. updating variables in OnVisible/OnHidden didn't work for me. It worked when I added it to methods under SharePointIntegration

Helpful resources

Announcements
secondImage

Demo-Extravaganza 2020

Check out these cool Power Apps & vote on your favorite!

secondImage

Community Highlights

Check out whats happening in Power Apps

secondImage

Community User Group Member Badges

FIll out a quick form to claim your community user group member badge today!

secondImage

Power Platform 2020 release wave 2 plan

Features releasing from October 2020 through March 2021

Top Solution Authors
Top Kudoed Authors
Users online (10,499)