Global text parameters allow users to build parameters based on a discrete list of static text values, or based on free input. The parameter is then used to build custom formulas, custom lists, and variable lists, where dynamic elements are connected to the parameter's static text values.
A powerful way to use this feature is to write PQL or MDX text values, allowing users to build custom business logic based on code injected from a parameter.
Define the discrete list from the Members panel. Click the blue plus sign to add as many parameter members as necessary. To remove a parameter member, click the x next to it.
For each parameter member, add a value and caption. The value is the text value of the specified parameter member. The caption is the label that will be assigned to the value in the resulting parameter slicer.
Usually parameters are used to create a slicer which contains a list of elements; the user then chooses the desired element to inject it into the query at runtime. Choose 'Free Input' to enable the users the enter the input into themselves, rather than choosing from a list. For instance, say you're creating a parameter that will be used to show the top n items in the query. Instead of creating a slicer that lists various options, like Top 3, Top 10, and Top 25, you can select 'Free Input' to allow the users to manually enter whatever value they want.
Choose either a numeric format, or select 'Custom validation' to enter a Valid Regular Expression (Regex).
Alphabetical characters only: allows the user to input any alphabetical characters from A-Z.
Alphanumeric characters only: allows input of any alphabetical characters from A-Z, and any numeric values from 0-9.
No validation: allows input of all characters.
Custom validation: allows input based on the given Regex.
Using Global Text Parameters
Once the global text parameter has been saved, it can only be used by adding it to custom logic. It can be used to build:
- Custom formulas using the Textual Parameter node
- Add the Textual Parameter node to the canvas
- From the Select Elements panel, navigate through the folder tree to find and select the required parameter
- Custom lists using the Switch node
- Add the Switch node to the canvas
- In the Arguments panel click the folder icon
- From the folder tree find and select the required parameter - both discrete list text parameters and numeric parameters will appear
- Variable lists in Discover
- From the Choose Variable panel, find and select the parameter from the folder tree - both discrete list text parameters and numeric parameters will appear
Custom logic built using the parameter can then be added to queries in Discover, Present, and Publish.