Global Variable not persisting


#1

I have a set of pages and on say Page 4 on click of a button I set the value of Global Variable and proceed to Page 5. Based on the value of this variable I am setting text on buttons in Page 1, Page 2 etc to change and hiding a few widgets on pageload of those pages. The issue is that the value of the global variable changes momentarily and as Page 5 loads the Global Variable value changes back to default.


#2

Hi @kharve

Could you share your RP file and write some steps to follow so I can see what you’re seeing? If your file contains confidential information, feel free to remove those bits, and/or send it directly to us at support@axure.com.

Thanks!


#3

Looks like this is resolved for now. Earlier OnClick I was showing (Show/Hide) a dialog and then Wait for 4000 ms (with a loading spinner), then Set Variable Value and finally open Page 5.

I moved the Set Variable Value as the first step and now it persists. Not sure if this a bug or the correct way to setting up a variable value


#4

Glad you found your answer.

You’re right - If you are setting a variable when navigating to a new page, you’ll always want your set variable action before you navigate away.


#5

I was doing that… Before navigating away I was changing the value. I was looking at the console window for variable changes. Initially on click of the button the dialog DP opened and after a wait of 4000 ms, the variable value changed to 1 and when the next page loaded it reverted back to default value. When I moved the variable value interaction above (show/hide and wait) it persisted while navigating away from the page.


#6

Hi @kharve

I tried some tests here on my end but I wasn’t able to reproduce the original issue. I’d expect that if the “Set Variable” action is set anywhere before the “Open Link” action, the global variable value would persist. Can you post your file in its previous state? If there’s a bug here, I’d like to relay it to our QA team.

Thanks!


#7

This should be stickied. Took me a while to figure this out. My guess is that ideally Axure would honor the set variable rule even if it comes after the page change (can’t think of a reason why a user would want it to change for a split second).


#8

So glad I found this post. Was having the same issue. Since Axure reviews the instructions line by line from top to bottom, it ignores everything that comes AFTER the open link command, because it executes that command and leaves the rest behind.

What is weird, is that it actually momentarily changes the value of the global variable, but then when you reach the target page, it resets to the default value.

I think this a bug.


closed #9

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.