The values stored in a session variable can be displayed in any label, literal, textbox or dropdown list control using the SESSION function. For example, to set the email address field on a User record to the value of the MyEmailAddress session variable, specify this formula for the “Initialize when Adding Record” event:
= SESSION(“MyEmailAddress”)
The SESSION function can also be used in the Query Wizard to filter the items displayed in a table.
Step 1: In the Page Layout Spreadsheet, select a table control.
Step 2: In the Data Sources tab, select the appropriate query and open the Query Wizard (Edit…).
Step 3: In the Query Wizard, add a new WHERE clause containing a formula that restricts the contents, e.g.:
= SESSION(“MyCity”)
Step 4: Build and run your application.
Alternatively, you can constrain a FieldFilter control by specifying a formula for the “Populate from Database” event.