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

Cannot reset variable

I have an app which is linked to SharePoint form.

 

There is a context variable which needs to be reset every time a form is opened. I tried to add "UpdateContext" to both "onHidden" and "onVisible" events, but "UpdateContext" isn't firing in either event.

1 ACCEPTED SOLUTION

Accepted Solutions
mdevaney
Level 8

Re: Cannot reset variable

@radenkovic_rr 

I didn't consider this earlier but you are correct that OnNew/OnEdit will not accept any UpdateContext function.  You must use the SET function to store a global variable instead.

View solution in original post

4 REPLIES 4
mdevaney
Level 8

Re: Cannot reset variable

@radenkovic_rr 

Instead, you can try clicking on SharepointIntegration within the Tree-View menu (left panel) and changing the following properties

  • OnNew
  • OnEdit
radenkovic_rr
Level: Powered On

Re: Cannot reset variable

@mdevaney 

 

Thank you for the quick reply.

 

When I try to add "UpdateContext" to "onEdit", I am seeing an error message "Update context cannot be used in a property of the app object".

 

Here is the change which I am trying to add: "UpdateContext({var1:Blank()})"

mdevaney
Level 8

Re: Cannot reset variable

@radenkovic_rr 

I didn't consider this earlier but you are correct that OnNew/OnEdit will not accept any UpdateContext function.  You must use the SET function to store a global variable instead.

View solution in original post

radenkovic_rr
Level: Powered On

Re: Cannot reset variable

Thank you @mdevaney , changing context variable to global variable did the trick!

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
Users Online
Currently online: 360 members 5,972 guests
Please welcome our newest community members: