1. Home
  2. Docs
  3. NoCode-X Documentation
  4. Templates
  5. Template parameters

Template parameters

Just like actions, templates can define a set of parameters. The application (or the users themselves) can then pass values to these parameters, influencing the appearance and behavior of templates and actions.

Attributes

Template parameters have the following attributes:

AttributeDescription
TypeA parameter can have the following types:
– String
– Double
– E-mail
– Date
– URL
– Number
– Password
– Action
– Selection
– Multi Select
NameChoose a name for this parameter.
DescriptionProvide a description for this parameter. This is optional.

Create parameters

To add parameters to a template, follow these steps:

  1. After entering the template editor, open the menu on the right.
  2. Click the Template parameters drop-down menu. This is shown in the image below.
  3. Press the Add a parameter button.
  4. Choose a parameter type. If, for example, only numbers are allowed, you should pick the Number type.
  5. Choose an appropriate name. This field is mandatory.
  6. Write a description for this parameter.
  7. Done. The parameter will be saved automatically. An example parameter is shown in the second image below.

Repeat the above procedure to create more parameters for the same template.

The Template parameters menu, with no parameters defined yet.
An example template parameter, indicating the maximum amount of articles displayed on the page.

Pass parameters to a template

There are multiple ways to pass parameter values to a template:

MethodDescription
In the page’s URLYou can pass arguments to a template at the end of the page’s URL. Prefix the first parameter with “?” (without the quotation marks), then write PARAMETER_NAME=param. PARAMETER_ NAME is the name of the parameter, and param is the actual value you want the parameter to have in this case. Additional parameters in the URL must be prefixed with “&” (again without quotation marks) to separate them. The image below shows an example URL with one parameter RESTAURANT_NAME with the value Tristan’s Diner.
In certain functionsWhenever you use a certain function to call a template, you can provide the template parameters along with it. NoCode-X will list the parameters belonging to the template and check that you entered values with the correct types. After selecting the template from the scope or the complete list of templates, you can provide the parameters for the chosen template. Example: the Add template component to list function. Every function with this functionality can be found on the All functions page.

This is the preferred way to pass parameters to templates. NoCode-X allows you to handle the passing of parameters entirely within the development platform, so your customers will not have to pass these arguments in URLs themselves.
URL with a parameter passed to it.

Use template parameters

In templates

Template parameters can be used in templates by surrounding the parameter name with double curly brackets. It looks something like this: {{PARAMETER_NAME}}. This can be used in components that contain text. For a list of all components, see the All components article.

In Actions

Actions that are executed within a template and that require data that is passed to the template through parameters can automatically inherit these parameters by defining the same parameters inside the action.

How can we help?