Previous Topic: How to Create a Dynamic TableNext Topic: Configure the Dynamic Table


Create the Dynamic Table

You can create a dynamic table to enter structured data from a report data object into a form.

Follow these steps:

  1. Create or edit the report data object or API plug-in that you plan to use to populate the dynamic table.
  2. Keep in mind the following: The data returned by the variables in the report data object or API plug-in must match the format required by the columns in the table. Otherwise, the data is not displayed to users when they open the form in a request. Later steps explain this requirement in greater detail.
  3. Edit or create the form in which you want to add the table. Expand the form.
  4. Do the following to add the Table element to the form:
    1. (Optional) Create a field set to contain the table.
    2. Expand the System folder, drag the Table element, and drop it on the form. If applicable, drop the table onto the field set that you created in the previous step.
    3. Specify an _id value for the table and save the form.
  5. Do the following to add the report data object or API plug-in to the table:
    1. Select the Table element.

      The attributes of the Table element appear.

    2. If you are using an API plug-in, specify the values of the following attributes:
      • Report/Plug-in Id: Enter the ID of the API plug-in that you want to use. You can find values for these attributes on the Administration, Tools, Plug-ins page. Copy the Id of the plug-in that you want from that page and paste it into the value of the Report/Plug-in Id attribute.
      • Report/Plug-in Variables: If applicable, open the API plug-in that you selected to display its details, including variables. On the details page, the Inputs section lists the ID values and descriptions of the input variables for the plug-in. Copy the Ids of the variables that you want from that page and paste them into the value of the Report/Plug-in Variables attribute.
    3. If you are using a report data object, specify the values of the following attributes:
      • Report/Plug-in Id: Enter the ID of the report data object that you want to use. You can find values for these attributes on the Administration, Report Builder, Data Objects page. Click the Edit icon of the report data object you want to display its properties. Copy the ID of the report data object from that page and paste it into the value of the Report/Plug-in Id attribute.
      • Report/Plug-in Variables: If applicable, Click the Edit icon for the report data object that you selected to display its properties, including variables. On the properties page, the input variables for the report data object appear as follows:

        For a Query: The input variables appear as %expression% statements.

        For Plug-in: The input variables appear in the Arguments field.

        For CSV: The input variables do not apply.

        Copy the variables that you want from that page and paste them into the value of the Report/Plug-in Variables attribute.

      For both attributes, enter variables as a JSON expression, for example:

      	$({'<variable name>' : '<variable value>', ...})
      
      	$({'userid':_.user.id,'rm_orgunit':ca_fdGetSelectedOptionValues(ca_fd.formId,'orgunit_id')})
      

      Important! Specify variables carefully. If you specify no variables, unpredictable results can occur.

    4. Save the form.

    When users complete this form while requesting a service, the report data object or API plug-in runs and returns the data that you specified.

You have created the dynamic table. Next, you configure it.