In this tutorial, you'll learn how to pass user-provided text from one page to another using global variables.
1. Widget and Page Setup
Open a new RP file and open Page 1 on the canvas.
Drag a text field widget and a button widget onto the canvas from the Libraries pane.
Add a second page to the project and open it on the canvas.
Drag a rectangle widget onto the canvas.
2. Create a Global Variable to Store the User's Input
In the top menu, go to Project > Global Variables.
In the Global Variables dialog, click Add to add a new variable. Name it
Click OK to close the dialog.
3. Capture the User's Input and Go to the Next Page
Set the Variable's Value to the Text Field's Text
Open Page 1 on the canvas and select the button widget.
Click New Interaction in the Interactions pane.
Select the OnClick event in the list that appears, and then select the Set Variable Value action.
Select the TextInputVar variable in the Target dropdown.
In the Set To dropdown, select text on widget. Then select the text field in the Widget dropdown below.
Click OK to save the action.
Open Link to Page 2
With the button widget still selected, click the Insert Action icon at the bottom of the OnClick block, and select the Open Link action in the list that appears.
Select Page 2 in the Link To dropdown and click OK to save the action.
4. Display the User's Input on Page 2
Open Page 2 on the canvas and click New Interaction in the Interactions pane.
Select the OnPageLoad event in the list that appears, and then select the Set Text action.
Select the rectangle widget in the Target dropdown.
Click the fx icon to the right of the Value field to open the Edit Value dialog.
At the top of the dialog, click Insert Variable or Function. In the list that appears, select TextInputVar under the Global Variables heading.
The field at the top of the dialog should now read:
[[TextInputVar]]. (This bracketed expression will be replaced by the variable's value in the web browser.)
Click OK to close the Edit Value dialog, and then click OK again to save the Set Text action.
5. Preview the Interaction
Preview Page 1 and enter some text in the text field.
Click the button to navigate to Page 2. The text you entered in the text field should be displayed on the rectangle widget.