viewData

Prev Next

Task Purpose

The viewData task displays a form to users containing job data and enables decision-making for the next workflow step.

Potential Use Cases

  • Approval workflows where someone needs to review data and approve or reject
  • Debugging or monitoring where operators need to see workflow state and decide whether to continue or retry steps

Properties

The following tables lists the input and output parameters for the viewData task.

Incoming Type Description
header string Required. Bold header text displayed at the top of the form.
message * (any) Required. Informational text that helps users make their selection. Accepts plain text, HTML, and CSS.
body * (any) Required. Main content area displaying data or instructions. Accepts plain text, HTML, and CSS. You can also reference JSON variables from previous tasks or use variable substitution with the variables parameter.
variables object Variables used in the body. Each key is a variable name; each value is the replacement string. Use the syntax <!variableName!> in the body to reference these variables. See example for usage.
btn_success string Required. Label text for the success button.
btn_failure string Required. Label text for the failure button.

 

Outgoing Description
none The task produces no direct output variables. User selection of btn_success or btn_failure triggers corresponding Success or Failure transition types.

How to Configure

This example shows how to configure a viewData task that displays time information and allows workflow re-execution. The example includes a getTime task to demonstrate the integration. See getTime for reference.

Figure 1: Job Canvas
ViewData-ex04-canvas

This example shows how to configure a viewData task that displays time information and allows workflow re-execution. The example includes a getTime task to demonstrate the integration. For more information about the getTime task, see the Task Reference guide.

To configure the viewData task:

  1. In your workflow canvas, add getTime and viewData task as shown in Figure 1.

  2. Select the viewData task and configure the following inputs:

    • Summary (optional): Enter The Current Time to describe the task purpose.
  • header: Enter The Current Time is...
  • message: Enter When this Automation was executed, the time was:
  • body:
    • Set Reference task to getTime
    • Set Reference variable to time (the default output parameter from getTime)
  • btn_success: Enter I am done.
  • btn_failure: Enter Do it again.
  1. Configure transitions between tasks as shown in Figure 1.

Figure 2: Input Header and Message
ViewData-ex05-input

 

Figure 3: Input Body and Variables
ViewData-ex06-input

 

Figure 4: Input Success and Failure Labels
ViewData-ex07-input

 

Figure 5: Operations Manager
ViewData-ex08-JobManager

After the workflow reaches the viewData task, a Work Task link appears on the ViewData task of the active job in Jobs (Operations Manager). Users can click this link to open the form and make their selection.

 

With the design of this automation, if the user selects the I am done button, the job will end. In contrast, if the user selects the Do it again button, the revert transition will return the job to the getTime task and obtain a new current timestamp. The user will then have the option to run the Work Task again, and once more be presented with the ViewData form. This loop continues until the user selects the I am done or the Cancel option in the task.

If the user selects the Cancel option on the ViewData form, the modal window will close, but the Job will continue running until it is worked by a user, or cancelled entirely.

Figure 6: Task Auto-Work
ViewData-ex09-AutoWork

Example

The ViewData variable field allows you to provide JSON properties (strings) that can be used in the body of the viewData task. To do this, you have to use IAP-specific syntax in the body <! parameterName!>.

In reference to the configuration example above (Figure 3), instead of rendering the JSON values in the body property, you can use the getTime response as the input variables. In this example, we updated the viewData task body to something such as The current time is <!time!> to extract the string property, and we updated the input variables to be the getTime task.

Figure 7: Using GetTime as the Input Variables
ViewData-ex10-syntax

 

Once the automation run is complete, a Work Task link (Start Auto-Work) displays on the ViewData task of the active Job in Jobs (Operations Manager). Clicking the link will open the task form that was prepared earlier.

Figure 8: Operations Manager
ViewData-ex11-TaskManager

Related Reading

For related information, see the ViewData API reference.