Simple ASP.NET External Form Using Data From Decisions

Last Updated: 05/03/2018 Introduced in Version: 2.0

External Form step was designed in Decisions to interact with forms using html methods or service calls. External Form step could be found in the Flow Designer in the ToolBox under  category. This method can also pass data into external form and retrieve data from the external form.

 

Example

 

In this example we are going to pass data from Decisions to external ASP.NET web form using POST method, and display this data as Form’s Labels.

We begin with creating New Flow in the Designer Folder. Next, we Name our Flow and click Create to proceed to the Flow Designer.

 

In the Flow Designer start-up window we select External Form step from Flows,Rules, Forms and Reports > Forms[Interaction] category. Click Add  to add it to our flow.

 

Next, we locate Url options setup box in the ToolBox… From Mapping Type dropdown we choose Constant and insert url to our external form into Value field.

Next, under Service Definition options for this step we locate Service Outcomes box and click Add New link to add new outcome from our External Form step.

 

In the resulting pop-up window we give our Outcome name… For this example we are not expecting any data to be returned from the external form so we are not adding any Parameters. We click Ok to save and close this pop-up window.

 

To send data to our form we need to populate our External Form step with data we want to send. To do this we locate Expose Data On Service box and click Add New link to add new input Parameter.

 

 

In the resulting pop-up window we provide the Name to our parameter and click Type selector to define Type for our Parameter. Next we click Ok to save and close Type picker and click Ok again to save and close our Add Expose Data On Service window.

 

The same way we add all Parameters that we want to send to our form. In this case all of them are String types except Age which is an Integer Type.

 

We can connect our steps now in the workspace. Next, from our External Form’s options we choose Show Mapping Editor to populate our Parameters with actual data we want to send to the external form.

 

In the Mapping Editor we choose Constant type of input for all our Parameters.

Next, we can populate our Parameters with the desirable Values to send to our External Form… When we finish we click Ok to save and close Mapping Editor.

Mention that we can view all information about our External Form step. This information is about how our Flow step can interact with the external form. To view this information choose View Integration Detail from the External Form Options. The page with detail information opens in a new window.

This completes our flow. We can click Debug Flow link from 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.

Our form opens in a new window and it is populated with the information that we had sent to it.

In this case Decisions send our Data from Flow to the External Form in URL as Key – Value pairs. This External Form was designed in ASP.NET. It is easy to parse URL that we received in our Form and use this Data to populate fields in our Form like this:

 

When we submit our form our flow keeps running to the end. This is because Submit button triggers a simple method that builds a New URL using important Data that was sent to the Form from Decisions, and redirects user to this New URL that causes our Flow to Resume:

 

In the debugger we can see that flow ran with no errors. Additionally, we can check what data was sent to the form under Data tab in the debugger.

dataSentToForm

Note: This will not work on in crossdomain environment. For example if Portal Base URL in format [machine name]/decisions/Primary and we try to call Form on localhost.

External Form used in this tutorial can be downloaded here: ReceiveDataASP

Additional Resources