Conditionally display values in custom report templates

Tags
RV

In your reports, it can be very useful to hide certain values depending on the business context or intended use, or to display specific data instead of other data based on the choices made by users.

To meet this need, Causeway Field applies the display conditions configured in your forms when generating the report. Widget values are therefore displayed or hidden according to the defined settings.

Implementation example

To illustrate this use case, the example below includes:

  • One Multiple Choice widget
  • Two Number widgets.

Each Number widget is conditionally displayed based on the option selected in the Multiple Choice widget. Depending on the user’s choice, one Number widget or the other will be displayed.

To do this :

  • Drag and drop a Multiple Choice widget or Dynamic choices widget, then configure it as shown in the screenshot below.
image
  • Drag and drop two Number widgets, then configure them as shown in the screenshot below.
image
image
  • In your report template, specify the tags inherited from the Engine 1 and Engine 2 widgets, either by copying the tag from the Studio or by retrieving it from the available configuration file.
image
image
image
  • Depending on the option selected, the value returned will be the value from the widget corresponding to that choice, identified by the widget tag.
    • For Engine 1: ##number_00Msi3RB##
    • For Engine 2: ##number_SpEt6vxi##
  • Place the two tags next to each other. The value corresponding to the user’s selection will then be displayed.
image

Example when selecting Engine 2 in the form:

image

Display of the selected value in the generated report:

image

In this example, the process is illustrated using Microsoft Excel. The same principle applies to Microsoft Word, provided that display conditions are used in your forms.

💡

Going further.

You can also use the Excel IF() function to conditionally display values based on specific criteria.

The function uses the following syntax:

=IF(logical_test, value_if_true, value_if_false)

For example, if the value of the ##number_00Msi3RB## tag or the ##number_SpEt6vxi## tag is greater than 50, the corresponding tag value will be displayed. Otherwise, the cell will display “KO”.

image