Set value of template parameter
Function: Set value of template parameter
This action allows you to dynamically update the value of a specific parameter within the template that is currently being used or displayed. This is useful for making parts of your template interactive or responsive to user input or data changes, without needing to reload the entire template.
Input
- Parameter: (Type: Text, Required) The exact name of the template parameter you want to update. This name must match a parameter that has been defined within your current template.
- Value: (Type: Any, Optional) The new value you want to assign to the specified template parameter. This can be any type of data, such as text, a number, a true/false (boolean) value, or even data retrieved from another part of your application or a database.
Output
This action does not produce a direct output that can be used by subsequent actions. Its primary effect is to modify the state of the current template by updating one of its parameters.
Execution Flow
Real-Life Examples
Here are some practical ways you can use the "Set value of template parameter" action in your applications:
-
Example 1: Personalizing a Welcome Message
- Scenario: You have a user dashboard template, and you want to display a personalized welcome message like "Welcome, [User's Name]!" when the page loads.
- Inputs:
- Parameter:
welcomeText - Value:
Welcome, \{\{CurrentUser.FirstName\}\}!(assumingCurrentUser.FirstNameis a variable holding the logged-in user's first name)
- Parameter:
- Result: The
welcomeTextparameter within your dashboard template is updated. If the current user's first name is "Alice", the template will now display "Welcome, Alice!".
-
Example 2: Controlling the Visibility of a Section
- Scenario: On an order form, you have a "Special Instructions" section that should only appear if the user checks a "Add Special Instructions" checkbox.
- Inputs:
- Parameter:
showInstructionsSection - Value:
\{\{Checkbox_AddInstructions.IsChecked\}\}(assumingCheckbox_AddInstructions.IsCheckedis a boolean value indicating if the checkbox is checked)
- Parameter:
- Result: If the checkbox is checked, the
showInstructionsSectionparameter becomesTrue, making the "Special Instructions" section visible in the template. If unchecked, it becomesFalse, and the section is hidden.
-
Example 3: Setting a Default Quantity for a Product
- Scenario: When a user selects a product from a list, you want to automatically set the quantity field in the product detail template to a default of
1before they manually adjust it. - Inputs:
- Parameter:
selectedProductQuantity - Value:
1
- Parameter:
- Result: The
selectedProductQuantityparameter in the product detail template is set to1, so the user sees a pre-filled quantity of 1 for the chosen product.
- Scenario: When a user selects a product from a list, you want to automatically set the quantity field in the product detail template to a default of