Carry Text Variables


I’m new to creating variables and the demo’s I’ve seen are pretty complicated. Can someone help me understand how I could allow the user’s name to prepopulate in the secondary page? I would love a simple example of how this is accomplished.

I am trying to prepopulate into the input field as well as into the text string in the error text onscreen.

Test_variables.rp (284.2 KB)

I simplified your file so it will be easier for you to see how to do it. I created a global variable for name. When someone enters the name, it saves it to the global variable. On the account page, you then pull in the value of that global variable.

Test_variables_edit.rp (83.4 KB)

I hope that helps!

Awesome I can’t wait to take a look! Would it be too much trouble to save as Axure 8.0 version?

Hi! I just looked and I guess there is no way to backsave a file so I can’t actually send you a file you can see, bummer! I took a couple of screenshots that may help you see what I did. Not the best but it might help to show you. Here is a link on adding global variables: Variables · Axure Docs

Thank you kindly I’ll be taking a look and using a different mac with the upgraded version - hopefully it will make enough sense (it seems to be pretty simple to designate it as a Var and then call it) for me to reverse engineer it in version 8.

OK I’ve tried to recreate the code done in Axure 9 to Axure 8 and here are the steps I’ve followed:

  1. Create global variable called “Name” by going to Project > Global Variables.

  2. Insert a text field. Label it “Name”

  3. Tell continue button on click to go to page “Account”.

  4. On “Account page” insert a text field. (Leave text field name blank)

  5. On text field - On Load Set Text on This widget equal to value of Name

No Luck! It never populates the field on the Account page in Axure 8. Let me know if there are suggestions.


Basically, make a global variable and set it equal to [[This.text]] for the situation you want to gather the text, for example, if you want the global variable to equal the text being clicked, simply set the variable value to [[This.text]] as onClick for the text being clicked. This will now hold the text onto the variable, you can also view the current value of it on the Preview > Console then just use the variable onto other pages you want.

From your steps it sounds like you have almost everything you need (the variable, the original text field, the button that opens the link, and the OnLoad action that sets the widget’s text to the global variable value) but are missing the action that saves the value of the text field on the first name to the global variable prior to opening the “Account” page, which is why nothing appears in the “Account” page’s text field. You can add an OnTextChange interaction to the text field on the “Home” page as hkmusil demonstrated if you want the variable value to be saved as the user types. Using OnClick to set the variable value prior to opening the link to the “Account” page should also work. The tutorial below can further guide you on how to pass text from one page to another:

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