This workbook is designed to accompany section 209 - Child FLOs.
For this workbook, you should have your own environment with login credentials.
If you are using a Production environment, please take care with any existing processes.
You may also elect to use 30-day free Trial Org by visiting: https://azuqua.com/sign-up
Because this is an Integration product, we will encourage you to use freely-available applications within this material. Tools such as Twitter, Slack, and others are great products and typically allow you to sign-up for free!
Exercise 209-1 - A Basic Child FLO
Let’s do an easy example of a Function or Subroutine (a Helper FLO, in other words) …
Perhaps we are doing a Marketing campaign and want to reach only our Twitter followers in a particular location or area and are active.
NOTE: This FLO won’t be fully complete … we’re just demonstrating how to call a Child FLO.
To create this Child FLO:
- Create a New FLO
- Name the FLO: “209- 1 - Twitter - Location Match Child FLO”
- Select “Child FLO” as your Event
- Add “Username” and “Location” as the input fields
- Select the Twitter >> Get User Profile Card
- Add an If/Else card
- Conditions: Location = Location
- If true, return location_match = True (True/False)
- If false, return location_match = False (True/False)
- Save the Card
Create a new FLO which calls the Child FLO:
- Create a New FLO
- Name the FLO: “209- 1 - Twitter Location Check”
- Add an Assign Card
- Field: Location
- Value = “Seattle, WA”
- Field: Username
- Value = “azuqua”
- Add a “Call FLO” card
- Select the FLO: “209- 1 - Twitter - Location Match Child FLO”
- Drag the Username and Location fields to the appropriate fields that appear
While this is a rather basic Child FLO, it shows how we can pass information back and forth easily!
Exercise 209-2 - Looping (the “For Each” Card)
Most FLOGrammers quickly learn the need for operations which “loop”. Let’s take an example of this …
Perhaps I have a list of contacts and I want to traverse this list and send an email to every person on that list. Within a FLO, this would be a “For Each” action.
Here, we’re going to do the following: Take a ;ist of contacts and traverse this list and send an email to people that match a criterial on this list.
- Create new FLO
- Narrative: First, let’s create a new (Parent) FLO
- Use a “Construct” card to create a list of text (email addresses)
- Add four fields for email addresses and add them
- Add a “List >> For Each” card to call the Child FLO
- Click the button to create a new Child FLO
- Drag the “list” output from the List >> Construct card to your “List >> For Each” card
- Create the new Child FLO
- Now, let’s jump over to the Child FLO. The parent is not quite finished, but we need to configure and test our Child card
- Set the inputs
- In this case: Email address
- This is an important key in working with Child FLOs!
- They come directly from the item that is being processed, so if the object you’re processing has field X and Y, you’ll need to add those here.
- We want to send email to people on this list, so we’ll take each email - one at a time - and do something with them.
- Step 1: Add a “Text >> Find” Card
- Add the Text >> Find Card
- Look In: email (Drag email over to this field)
- Look for: “gmail.com”
- Step 2: Add a “Branching >> Continue If” card
- Set “Value a” = “position”
- Drag this from the output of the Text >> Find card
- Set “Comparison” equal to -1 (value b)
- NOTE This will filter out anyone with the “gmail.com” domain
- Step 3: Add a “Text >> Compose” Card
- Craft a message that you’ll want someone to read
- Drag the email field from the first card as the email
- Step 4: Add an email card
- NOTE This depends on your email client. If you have Gmail, use the “Gmail >> Send Email” card!
- For Testing, we suggest using your email in the “To” line
- Add a Subject of your choice
- Drag the output from the “Text >> Compose card”
- Save the child FLO and turn it on
Important: Note that this whole idea of child FLO is that you can do as many steps as you need on each item – one at a time.
Go back to the parent FLO and complete it … Note that the “email” field that we created in the Child FLO **now appears as an item in the “With the following values” section!
- Make sure the Child FLO you created is selected
- e.g. “209-2 - Looping - Child FLO”
- Select the email drop-down and choose “item”
- Save the FLO
- Run the FLO
Your FLO should look as follows …
Now run the FLO and make sure you’re getting the correct output.