Josh Nerius

5 minute read

In New for Developers in Kingston - Flow Designer, Action Designer, IntegrationHub, I touched on the basics of Flow Designer.

In this post, I’ll spend some time exploring Flow Designer in more detail. Instead of trying to look at every aspect of Flow Designer in one post (that’d be a long post), I’m going to walk you through the process of creating a simple flow and we’ll touch on many of the core concepts in the process.

The flow we’ll build:

  1. Is triggered when when a user is added to a group
  2. Looks up all existing members of the group
  3. Sends an email to every member of the group welcoming the new user

Launch Flow Designer

Launch flow designer by navigating to Flow Designer > Designer.

blog_fd_nav.png

This opens the Flow Designer UI in a new window.

blog_fd_main_ui.png

Create a new Flow

Click the + New button, and then click the New Flow option in the dropdown menu.

blog_fd_new_flow_button.png

Fill out the form and then click the Submit button.

blog_fd_new_flow_form.png

You will be taken to a new tab containing the newly created flow.

blog_fd_flow_created_blank.png

Define a Trigger

Triggers determine when the flow will run. Click the Click to add a Trigger button, and the list of available Triggers will open.

blog_fd_define_trigger.png

As you hover over each trigger type, inline documentation describing how the trigger functions will be shown. Click the Created trigger, and then populate the Table with the table of your choice. In our case, we want this flow to run every time a new record is created in the Group Member [sys_user_grmember] table. After selecting the table, click the Done button.

blog_fd_define_trigger_select_table.png

Note: We could have defined a condition, but we want this to run for every group member creation.

Add Actions

After the Flow is triggered, we want to execute a series of Actions. Add an action to the flow by clicking the Click to add an Action or Flow Logic button (or just click the big circle with the +).

blog_fd_add_action_button.png

Next, click the Action button.

blog_fd_add_action_button.png

This will open a searchable list of available actions.

blog_fd_list_of_actions.png

Hovering over an action will display inline documentation about that action and what it is used for.Click the Look Up Records Action.

  1. Set the Table to Group Member [sys_user_grmember].
  2. Set the condition to Group is.
  3. Drag the Trigger > Group Member Record > Group data pill from the Data pane into the condition input.

blog_fd_drag_pill_to_lookup_filter.gif

We just did something very interesting. We took an output variable from the original trigger and used it to drive the Look Up Records query. This is a key concept in Flow Designer b when actions have outputs, those outputs can be used by subsequent actions.Because the output from the Trigger was a GlideRecord, we could drill into that GlideRecord and use the group field to drive the lookup query.

Loop Over Records

Next, we’ll add a For Each loop. Select the Click to add an Action or Flow Logic button, click Flow Logic and select the For Each menu item.

blog_fd_flow_logic_for_each.png

Next, choose the collection of records to loop over. In this case, we want to iterate over the result from the Look Up Records step.

blog_fd_cannonball_picker.gif

Note: we could have also dragged/dropped the value from the data pane.

Adding Actions Inside a Loop

Now that the For Each loop has been configured, you can add actions inside it by clicking the + button under the loop. Any actions added this way will be executed once per record.

blog_fd_for_loop_inner_action_button.png

Add a Send Email Action.

  1. Expand 2 b For Each in the Data pane and drag the Group Member Record > User > Email value into the To input.
  2. Define a Subject that incorporates the user’s name taken from the Trigger.
  3. Write a Body message of your choosing.
  4. Click Done.

blog_fd_email_inputs.png

Test the Flow

Next, we need to test the flow. Flow Designer has built-in testing functionality that makes it easy to manually trigger flows and inspect the results. Click the Test button.

blog_fd_test_button.png

A new dialog will open. Choose the record you wish to test this flow against. Click the Run Test button. After the flow executes, click Flow has been executed. To view the flow, click here.

blog_fd_test_ran_click_here.png

This will open the execution details for the test run. There is a wealth of information here b click everything!

blog_fd_execution_details.png

Clicking the Trigger reveals more details info about the record that triggered this flow.

blog_fd_execution_details_trigger_details.png

Clicking any action will show the runtime values passed into an action, the values returned by the action, log files, etc. In the screenshot below, we can see that there were four records returned by the group member query.

blog_fd_execution_details_lookup_records_details.png

When inspecting the results of a loop, we can select which iteration we want to inspect. In the screenshot below, we’re looking at the 1st iteration out of four. We can see our flow configuration coming to life b the dynamic values we inserted into the subject line show up in the runtime value column with real values from the user record.

blog_fd_execution_details_for_each.png

I’m really in love with the execution details view. This gives me everything I want to see about the flow’s execution at a glance, and I don’t need to go hunting through log files, or enable extra debugging to see the results of my test.

Activate the Flow

Now that we have a working flow, there’s one thing left to do: Activate it.

blog_fd_click_activate_button.png

Confirm that you really want to activate this on the resulting confirmation dialog, and your flow is live!

Summary

This post touches on some key Flow Designer concepts:

  • Triggers
  • Looking up records
  • Iterating over records
  • Passing data from one action to the next
  • Testing the flow and inspecting execution details

But there’s always more to learn. My advice? Just try stuff. Experiment with the other actions available to you. Play with if/else logic. Try out the approvals action.

I’ll keep writing about Flow Designer and IntegrationHub, but don’t wait for me!

Additional Resources


Comments