viewData
  • 26 Oct 2023
  • Dark
    Light
  • PDF

viewData

  • Dark
    Light
  • PDF

Article summary

Task Purpose

The viewData task presents the user with a form that contains job data, which provides the user with a decision path regarding the next (preplanned) step.

Properties

Input and output parameters are listed below.

Incoming Type Description
header string Required. A bold header value for the form that is displayed to the user.
message * (any) Required. An informational value specified by the automation designer to help the user make their selection.
body * (any) Required. An informational value specified by the automation designer to help the user make their selection.
variables object The variables used in the body. Each key represents a variable name, and each value represents the string that will replace it. See below for more variable-specific examples.
btn_success string Required. The value displayed on the button that represents the continued "success" path of the automation.
btn_failure string Required. The value displayed on the button that represents the continued "failure" path of the automation.

Outgoing Description
none There are no tangible outgoing variables, but the task does recognize the difference between the user's selection of btn_success or btn_failure. Outgoing transition types of "Success" or "Failure" are triggered by the user's selection.

How to Configure

In this configuration example, the addition of a getTime task will help illustrate how the viewData task is utilized. For more information on the getTime task, refer to the related Task Reference guide in the documentation.

Figure 1: Job Canvas
ViewData-ex04-canvas


For the ViewData task:

  • The input for Summary is set to "The Current Time". Setting this field is an optional step, but used here to illustrate how this example aligns with the complete automation that is shown above.
  • The header Reference variable is set to (without quotes) "The Current Time is...".
  • The message Reference variable is set to (without quotes) "When this Automation was executed, the time was:".
  • The body Reference task is set to reference the getTime task, while the Reference variable is set to "time" (the default output for the getTime task).
  • The btn_success Reference variable is set to (without quotes) "I am done."
  • The btn_failure Reference variable is set to (without quotes) "Do it again."

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


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 opens the task form that was prepared earlier.

Figure 5: Operations Manager
ViewData-ex08-JobManager


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 "<! !>" (without the quotation marks).

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

Potential Use Case

Let's say you want to construct an automation for an educational testing service that evaluates the progress of online users. You have constructed an automation that asks the user "true or false" questions using the viewData task. Depending on the answer, the automation will either send an email to the test proctor that the user is performing poorly, or will add a point to a database record that indicates the user is performing successfully.

References

For related information on the viewData task, see the ViewData API reference.


Was this article helpful?

What's Next
Changing your password will log you out immediately. Use the new password to log back in.
First name must have atleast 2 characters. Numbers and special characters are not allowed.
Last name must have atleast 1 characters. Numbers and special characters are not allowed.
Enter a valid email
Enter a valid password
Your profile has been successfully updated.