Dynamic values

Modified on Wed, 17 May, 2023 at 12:48 PM

In expressions, dynamic values are values which are dynamically obtained by the expression at the time of its evaluation. 


Example: You want to add a text report element to a report and you want the text element to contain the current value of the datasource field "Year". In that case, you would use a dynamic value that will be evaluated by Mail & Deploy when creating the text element. 

The exact syntax of dynamic values depends on the type of dynamic value.


Datasource Field Value
This dynamic value can be used to insert the values of a datasource field. Only values which match the current filter state of the datasource will be added. If you want to manually type in the dynamic value, you can use the following syntax:

[Datasource].[<name_of_datasource>].[Field].[<name_of_field>]

If you want to automatically insert the syntax for this dynamic value, you can click the button in the expression editor and then click Datasource Field Value. A new dialogue will appear which allows you to select the datasource field whose value you want to access.


Datasource Variable Value
This dynamic value can be used to insert the value of a datasource variable. If you want to manually type in the dynamic value, you can use the following syntax:

[Datasource].[<name_of_datasource>].[Variable].[<name_of_variable>]

If you want to automatically insert the syntax for this dynamic value you can click the button in the expression editor and then click Datasource Variable Value. A new dialogue will appear which allows you to select the datasource variable whose value you want to access.


Datasource Expression
This dynamic value can be used to insert the return value of an expression which can be written in the syntax of the datasource used. If you want to manually type in the dynamic value, you can use the following syntax:

[Datasource].[<name_of_datasource>].[Expression].[<expression_code>]

If you want to automatically insert the syntax for this dynamic value you can click the button in the expression editor, then click Datasource Expression, and then click the name of the datasource for which you want to insert an expression. The code for the dynamic value will be inserted into the expression editor and you can immediately start typing the expression code in the syntax depending on your datasource. 

Example: You want to add the maximum value of the datasource field "Revenue" into the expression. The datasource used is a QlikView Document. If there is no datasource field or variable that contains the maximum value of "Revenue", you can choose to add a datasource expression and then use the syntax "[Datasource].[<datasource_name>].[Expression].[max(Revenue)]". The value between the last brackets can be any expression syntax that is supported by the type of datasource used.


Datasource Object Title 
This dynamic value can be used to insert the title of a datasource object. If you want to manually type in the dynamic value, you can use the following syntax:

[Datasource].[<name_of_datasource>].[ObjectTitle].[<object_id>]

If you want to automatically insert the syntax for this dynamic value you can click the button in the expression editor, then click Datasource Object Title, and then select the datasource object for which you want to insert an expression. The code will then automatically be inserted into the expression editor.

Report Parameter 
This dynamic value can be used to insert the value of a report parameter. This type of dynamic value is only available in expressions in the context of a report. If you want to manually type in the dynamic value, you can use the following syntax:

[ReportParameter].[<name_of_reportparameter>]

If you want to automatically insert the syntax for this dynamic value you can click the button in the expression editor, then click Report Parameter and then click the name of the report parameter whose value you want to insert.


Task Parameter
This dynamic value can be used to insert the value of a task parameter. This type of dynamic value is only available in expressions in the context of a task. If you want to manually type in the dynamic value, you can use the following syntax:

[TaskParameter].[<name_of_taskparameter>]

If you want to automatically insert the syntax for this dynamic value you can click the button in the expression editor, then click Task Parameter and then click the name of the task parameter whose value you want to insert.


Expression Parameter
This dynamic value can be used to insert the value of an expression parameter; expression parameters are additional parameters which are only available in certain contexts. If you want to manually type in the dynamic value, you can use the following syntax:

[<name_of_expressionparameter>]

If you want to automatically insert the syntax for this dynamic value you can click the button in the expression editor, then click Expression Parameter and then click the name of the expression parameter whose value you want to insert.


Cycle Value 
This dynamic value can be used to insert the current value of a cycle. This type of dynamic value is only available in expressions in the context of a cycle action. If you want to manually type in the dynamic value, you can use the following syntax:

[CycleValue].[<name_of_cyclevalue>]

If you want to automatically insert the syntax for this dynamic value you can click the button in the expression editor, then click Cycle Value and then click the name of the cycle value whose value you want to insert.


Colour 
This dynamic value can be used to insert colour. This type of dynamic value is only available certain contexts. If you want to automatically insert the syntax for this dynamic value you can click the button in the expression editor, then click Colour; a dialogue will appear in which you can configure the colour to insert.

Local Variables
This dynamic value can be used to insert the value of a local variable that has been previously set to a value. If you want to automatically insert the syntax for this dynamic value you can click the button in the expression editor, then click Local Variable; a dialogue will appear in which you can select the local variable to insert.


Global Variables 
This dynamic value can be used to insert the value of a global variable. If you want to automatically insert the syntax for this dynamic value you can click the button in the expression editor, then click Global Variable; a dialogue will appear in which you can select the global variable to insert.

Please note, that global variables are calculated everytime you use them in expressions. If you reference a global variable multiple times, it will be evaluated for each of these references individually at the time of the evaluation.


Was this article helpful?

That’s Great!

Thank you for your feedback

Sorry! We couldn't be helpful

Thank you for your feedback

Let us know how can we improve this article!

Select at least one of the reasons
CAPTCHA verification is required.

Feedback sent

We appreciate your effort and will try to fix the article