Using GoTo Step and Catch Exception to Change Flow Execution
  • 02 Mar 2022
  • 2 Minutes to read
  • Dark
    Light

Using GoTo Step and Catch Exception to Change Flow Execution

  • Dark
    Light

Overview

Flow Execution paths can be changed by directing the path using a GoTo step to direct the path to another path or by catching Flow exceptions with the Catch Exception step. 


Example

The following example will display a Form to a user for information and direct the path to a Throw Exception step. The exception will be caught by a Catch Exception step and display an additional Form that will direct the user to continue the Flow or end Flow. 

  1. In a Designer Project, click CREATE FLOW and select Flow. Name the Flow and click CREATE. 
  2. Click the Done path of the Start step. Navigate to Flow, Rules, Forms, and Reports > Forms [Interaction] and select [Pick or Create Form]. Click ADD.
  3. On the Properties panel, click PICK OR CREATE FORM and select CREATE. Select Form, name the Form, and click CREATE.
  4. In the Form Designer, configure the Form to have four Text box components (To, From, Subject, Message) and a Button component (Send Email). Click Save and close the Form Designer.
     
  5. In the Properties panel, change the mapping of the input fields under the INPUTS category to Ignore.
     
  6. From the Toolbox panel, add a Send Email step from the FAVORITE STEPS category and connect it to the Send Email path of the Form step.
  7. On the Properties panel, click Edit Input Mappings.
  8. Connect each of the Form's outputs to its respective input value fields. Change the mapping of the To field to Build Array and map Item 0 to To. Click OK.
  9. Add a [Pick or Create Form] step from Flow, Rules, Forms and Reports > Forms [Interaction] category to the Sent path. Click PICK OR CREATE FORM, select CREATE, choose Form, and click CREATE.
  10. Configure the Form to have two Button components (Done, Send Another Email). Click Save and close the Form Designer.
  11. Attach a GoTo Step step from the FLOW MANAGEMENT category of the Toolbox panel. Connect this step to the Send Another Email path.
  12. Select GoTo Step. On the Properties panel, select Send Email Form from the GoToStepName field dropdown list under the SETTINGS category.
  13. Navigate to the FLOW MANAGEMENT > ERROR HANDLING category in the Toolbox panel, add a Throw Exception step to the workspace, and connect it to the Done path of the Send Another Email Form. On the Properties panel, enter "Exit Flow" into the Message field.
  14. From the ERROR HANDLING category, add a Catch Exception step onto the workspace.
  15. Add a [Pick or Create Form] step from Flow, Rules, Forms and Reports > Forms [Interaction] and connect it to the On Exception path.
  16. Create a new Form. Configure the Form with a Label (Are you sure you want to exit?) and two Button components (Yes, No). Click Save and close the Form Designer.
  17. Drag the Yes path to the End step.
  18. Attach a GoTo Step from the FLOW MANAGEMENT category to the No path of the Exception Message Form. On the Properties panel, select Send Another Email from the GoToStepName dropdown list. This will trigger the Flow to return to the Another Task [Form] upon selection of No on the Exception Message [Form] step.
  19. Click Save to save changes to the Flow.


Debug 

  1. Click Debug from the top action bar.
  2. Click START DEBUGGING.
  3. Fill out the Email Form and progress through the Flow to the exception. Test both the Yes and No paths of the Catch Exception Flow.
    Yes path:

    No path:

  4. After testing the No path, test the Send Another Email path.



For further information on Flows, visit the Decisions Forum.

Was this article helpful?