Purpose
The ViewData task will present the user with a form that contains job data, which provides the user with a decision path regarding the next (preplanned) step.
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 record in a database that indicates the user is performing successfully.
Properties
Input and output parameters are listed below.
Incoming | Type | Description |
---|---|---|
header |
string | Required. The bold header value for the form to be 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. |
btn_success |
string | Required. The value to be displayed on the button that represents the continued "success" path of the automation. |
btn_failure |
string | Required. The value to be 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" will be triggered by the user's selection. |
Example
In this 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.
Note: The broken red arrow is a failure|revert style transition. For more information on automation transitions, refer to the Automation Builder user guide.
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."
Once the automation run is complete, a Work Task link displays on the ViewData task of the active Job in Job Manager. Clicking the link will open the task form that was prepared earlier.
With the design of this automation, if the user selects the I AM DONE button, the job will end. In contrast, if the user were to select 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 will continue until the user selects the I AM DONE or the CANCEL option in the task.
If the user were to select 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.