Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Overview

 The Run variable macro is used to access the field values provided in other macros on the same page. This macro can be used with other macros such as Wiki, Markup, Groovy, SQL for Confluence macros, and so on.

...

ParameterDescription
Form IDEnter the form ID of either the Run with a user form and parameters and or the Run without user form macro. This value must be the same as specified in Run settings > Parameters > Unique form id of the macro editor.
Variable name

Enter the variable name as specified in the Field settings tab in the Run with a user form and parameters/Run without user form macro editor.

Use this value in other macros using the '$' sign prefixed to the specified variable.

...

Select the macro on the page to either edit or delete it from the page.

Examples

Let's consider the following scenarios:

...

Example

This section demonstrates how to access a field defined in the Run a user form and parameters macro and display this value through a Groovy macro. For this scenario, perform the following:

  1. Define field value within a Run a user form and parameters macro
  2. Access field value defined in another macro
Info

The query, database, field names and other values are for demonstrative purposes only. Please customize these values as per your instance.

...

Define field value

...

within a Run a user form and parameters macro

First, let's populate two select list boxes using the Dynamic Select field type in a Run a user form and parameters macro. To do so, the relevant profile and SQL query must be provided. See Field types for  for more information.

In the image:

...

Access field value defined in another macro

Let's build this example using In the previous scenario. A section, a Run a user form and parameters macro is defined with two dynamic select lists and now, the selection is to be used in a Groovy macro that's available on the same page. 

...

  • A Groovy macro contains a Run variable macro defined to access the form with DocTestForm01 ID, same as that of the Run a user form and parameters macro defined in the previous example.
  • Variable F12 stores the value of DYNSEL01 in form ID DocTestForm01. For this example, this value is simply displayed but it can be processed further as required.

...

  • Rochester is selected in DYNSEL01 and 'Chicago' in DYNMULSEL01 and the form is run.
  • From the first examplesection:
    • The Run variable macros returned the selected options in the lists.
    • The text below the Run variable macros shows how using the '$' sign allows the variable values can to be accessed.
  • From the second examplesection:
    • The selection made in the second select list with ID as DYNSEL01 is shown using the Groovy script.

...