Script Form Step For External Forms
- Updated on 19 Jun 2015
- 3 minutes to read
In this example we will configure a Script Form step to show a simple pop-up alert that will display Current User Email Address . Next, we will call our Flow back to continue Flow execution.
We begin in the Designer Folder with clicking Create Flow button on the Folder Actions Panel.
Next, we Name our Flow and click Create to proceed to the Flow Designer.
In the Flow Designer we add Script Form Step from the Flows, Rules, Forms and Reports > Forms [Interaction] category in the ToolBox .
Script Form step configuration window pops up. First, we need to add at least one Outcome to our step. We click Add New link in the Service Outcomes section.
In the resulting window, we name our outcome. If needed, we can Add Parameters that will be passed back from this step. Click Ok when finished.
Next, we can configure if we need System to generate service for this step by checking/unchecking Generate Service checkbox.
If we need to pass Data to this step we can Add Input Data in the*Expose Data On Service*** section.
Finally, we have two options for the Script Source: Data (to pass script data to the step) , and NVelocity (to type script manually) . In this example we use NVelocity Script Source.
Next, we add a Show Popup step from the Favorite Steps category.
In the resulting window we configure Subject and Message for our pop-up. And, click Add .
Then, we select Script Form step on the workspace and Step Information Layer pops up. We locate inputs for Email variable that we defined in our script, define its data Mapping Type as Select Value , and usingPath picker we select CurrentUserEmail from Flow Data category.
Note: Script Form step does not continue Flow execution automatically. It will wait on the External Form to finish its work and call back to Flow . To learn how can we call back to the Flow and continue execution on the desirable outcome from Script Form step, we click View Integration Details.
Next, we connect steps in our Flow as following and click Debug Flow link on the top panel of the Flow Designer to test our Flow .
Note that in Decisions version 3.5 and above, you'll need to click Test Flow to access the Debugger.
We return to the Debugger and observe our Show Popup step in action. Notification pops up and Flow is being terminated.
If we switch to the Diagram Tab in the Debugger , we can confirm that our Flow ran to theEnd Step with no errors.
Note: This will not work on in crossdomain environment. For example if Portal Base URL in format [machine name]/decisions/Primary/ - this will not work because Default Script Form tries to call localhost/decisions/Primary