Application Setting Variable:-
Application setting variables are reusable constant values that are defined once and can be used across all the forms in the same site. An application Settings variable is used to store information for the site. These variables can be accessed in the rules, data sources etc.
Working with an Application setting variable:-
Create an application setting variable, this can be done by opening Application settings menu from Links tab (Figure 1).
A wizard for creating variable will be opened in the right window pane (Figure 2).
Create a variable by entering key, value and description. All the fields are mandatory. An example is shown below (Figure 3).
After filling the fields click on save button.
How to access Application setting variable in forms:-
Application setting variable can be accessed by using AppSettings function this is illustrated below. Create a sample form for getting the value of the variable in a text box control (Figure 5).
AppSettings function: – This function is used to get the application settings of the current tenant. The syntax is shown in Figure 6.
The rule for getting the variable value inside the text box control on clicking Get Value button is shown below (Figure 7).
Form Preview: – On form preview, the value is been passed to textbox on the trigger of Get Value button (Figure 8).
Similarly user can access the value of the variable in any forms in the tenant.
An Appform Session variable is used to store information for a user session. Variables stored in Session variable hold information about one single user and are available to all forms in one application. Common information stored in session variables is name, id and preferences. The application creates a new session variable for each new user and destroys the session object when the session expires. These variables can be accessed in the rules, data sources etc.
Working with a Session variable:-
Create a Session variable; this can be done by opening Session Variables menu from Links tab (Figure 9).
A wizard for creating variable will be opened in the right window pane (Figure 10).
Create a variable by entering the variable name and then click on save button (Figure 11).
How to access Session variables in forms
Session variable can be accessed by using Session function this is illustrated below
Session Function: – This function is used to get the session variables of current tenant. The syntax of the function is shown in Figure 13.
The rule for accessing Session variable is shown in Figure 14.
User can access the Session variable in any forms in the application.