cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
skylitedave
Level 10

BUG - OnVisible Not Firing - SharePoint Integration - New - Cancel - New

On Visible does not fire if you hit New, Cancel, then New again for a form associated with a SharePoint list.  Will not fire on the second new screen.  Must refresh the browser showing the SharePoint list to have OnVisible fire the second time.Smiley Sad

1 ACCEPTED SOLUTION

Accepted Solutions
skylitedave
Level 10

Re: BUG - OnVisible Not Firing - SharePoint Integration - New - Cancel - New

Try using global variables (Set) in the OnStart or OnVisible of that screen.  Clear them out in the OnHidden

 

View solution in original post

12 REPLIES 12
Super User
Super User

Re: BUG - OnVisible Not Firing - SharePoint Integration - New - Cancel - New

 What do you have in your OnVisible setting? Is OnVisible set for the screen or a control?

Shane - Microsoft MVP, YouTube, and PowerApps Consulting for when you are in a bind to get this fixed quickly. And finally we now have PowerApps Training
skylitedave
Level 10

Re: BUG - OnVisible Not Firing - SharePoint Integration - New - Cancel - New

Hi

 

 OnVisible for the Screen

 

The OnVisible is used to reset Context Variables ( Local) - they do not reset if you do New in SharePoint , Then Cancel that screen , Then hit New in SharePoint again...  The OnVisible and OnHidden do not fire

 

 

Workaround

I just figured out a workaround 

I can put the code I need in the OnReset of a form on the screen and it will fire even though the Onvisible of the Screen will not fire.... 

So if you need to set up things when opening a new screen using the forms integration with SharePoint, then put that code in the OnReset of a Form on that screen and NOT in the OnVisible of the screen to get around this

 

 

Highlighted
BigShotRob
Level: Powered On

Re: BUG - OnVisible Not Firing - SharePoint Integration - New - Cancel - New

I would just like to confirm that this is definitely a bug, I've had this as well, I figured it'd be fixed by now but it's still impacting sharepoint list forms, the SP integration really loses a lot of what makes it nice when you have to tell users to refresh the page every time they want to submit a new item, I did a similar workaround to make this at least somewhat useable, though its still far from ideal.

Rick72
Level 10

Re: BUG - OnVisible Not Firing - SharePoint Integration - New - Cancel - New

I think that the following post is related: https://powerusers.microsoft.com/t5/Using-PowerApps/SharePoint-form-doesn-t-get-reset-on-New-item/td...

 

No answer/solution (yet) though.

haniel
Level 8

Re: BUG - OnVisible Not Firing - SharePoint Integration - New - Cancel - New

I have a similar situation, but in a Canvas form that is not using SharePoint.  The OnVisible on the screen wont fire.  I also don't have the OnReset method avaialble.  The code I'm trying to run is as follows:

 

UpdateContext({field1:value1})

 

When I run exactly the same code from a button, it works fine.

 

Any suggestions/work-arounds?

skylitedave
Level 10

Re: BUG - OnVisible Not Firing - SharePoint Integration - New - Cancel - New

Hi,

 

Here is a trick you can try

 

This assumes you are opening a new screen so you are using the Navigate function to get to this screen...

 

Look at the Navigate function you are using to get to this new screen...

 

See here

https://docs.microsoft.com/en-us/powerapps/maker/canvas-apps/functions/function-navigate

 

Here is a bit of code from that function

Navigate( Screen, Transition [, UpdateContextRecord ] )

  • Screen - Required. The screen to display.
  • Transition - Required. The visual transition to use between the current screen and the next screen. See the list of valid values for this argument earlier in this topic.
  • UpdateContextRecord - Optional. A record that contains the name of at least one column and a value for each column. This record updates the context variables of the new screen as if passed to the UpdateContext function.

So this may be a nice workaround for the issue you are seeing....  Set the context variable within the Navigate argument before you open that screen

 

Let me know if this works for you Smiley Happy

haniel
Level 8

Re: BUG - OnVisible Not Firing - SharePoint Integration - New - Cancel - New

@skylitedave, the problem is that my form is on the first screen.  I could add another screen before, but that would impact the overall user experience.  Here's the form as it currently looks.

 

Form.png

 

@Shanescows, any thoughts?

skylitedave
Level 10

Re: BUG - OnVisible Not Firing - SharePoint Integration - New - Cancel - New

Try using global variables (Set) in the OnStart or OnVisible of that screen.  Clear them out in the OnHidden

 

View solution in original post

SpoonsJTD
Level: Powered On

Re: BUG - OnVisible Not Firing - SharePoint Integration - New - Cancel - New

OnHidden isn't called either.

 

I have a SharePoint Powerapps form that sets a variable if a button is pressed. I clear the variable in OnHidden and OnVisible. If I open the list item, click the button that sets the variable, cancel, open a new list item -- the variable is still set to the old value. This happens for both global variables (Set) and context variables (UpdateContext). This is a pretty impactful bug.

 

It does appear that resetting the variables in OnCancel and OnSubmit as described in an earlier post does work.

Helpful resources

Announcements
firstImage

Microsoft Business Applications Virtual Launch Event

Join us for an in-depth look at the new innovations across Dynamics 365 and the Microsoft Power Platform.

firstImage

Watch Sessions On Demand!

Continue your learning in our online communities.

Power Platform 2019 release wave 2 plan

Power Platform 2019 release wave 2 plan

Features releasing from October 2019 through March 2020

FirstImage

Power Platform World Tour

Coming to a city near you

thirdimage

PowerApps Community User Group Member Badge

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

FourthImage

Join PowerApps User Group!!

Connect, share, and learn with your peers year-round

Top Kudoed Authors
Users Online
Currently online: 409 members 2,919 guests
Please welcome our newest community members: