Activepieces 101 / 3: Create Your First Dynamic Flow

In this lesson, you will be able to pass data from your trigger into your action(s) then test your steps, this is the true power of dynamic automation based on data you input. In case you need to understand what a trigger, an action and data are, click here for the previous lesson.

Before You Begin

Make sure to have:

  • An Activepieces account
  • A spreadsheet ready (we’ll use Google Sheets for this example)
  • An understanding of what a trigger, an action and data are from the [previous lesson] (Activepieces 101 / 1. Create Your First Flow).

Scenario

Imagine you get customer support inquiries, and you record them in a Google Spreadsheet.

The image below is the spreadsheet example we will be using in the tutorial and in our examples.

Let’s automate the process of sending two personalized emails whenever a new row is added to the spreadsheet. The first email we will send is for the customer, and the second email is for our support team.

Building the flow

  • We will begin by adding our trigger, in this case it will be “For Every New Row” by the Google Spreadsheet piece, after connecting we will find our file and select the targeted sheet then load sample data. We load the data from the sheet so we can later test it when we pass it to our action(s), we also need to make sure to select the correct data for testing, in our case there could be 2 results, the first row that has headings or the second row that actually has an email, a name and a description of the problem, if you guessed that we need to load the second row in the spreadsheet you are correct.
  • Then we will add a new action to send an email, we will be using Gmail, similar to our previous lesson, in this example we want to send an email to our customer.

PS: Since every new row will have a new customer with a different email that we cannot know beforehand, we want to take the email from the new row, it will be in column A.

  • Our previously loaded sample data will play a big role in making our flow dynamic, in our example we will not write the recipient’s email address ourselves, but rather we will select the email address from the values passed down from the trigger.
  • We can use the passed down data anywhere and however we want, so in our example we will also use the name in column B when we send an email to the customer to further personalize the email, then lastly in this action we will test the step, when a test is successful, we can pass down the output and add it to the next action if there is any.
  • We can create as many steps as we like, in our example we will also send an email to our customer support team informing them of the problem using the passed down data from the trigger, we don’t need to use data passed down from the previous email step as it is not beneficial to us in this scenario.
  • Finally, we will publish the flow so that whenever a new row is added to the spreadsheet, all its data will be sent to the trigger and passed down to the actions.

Watch this tutorial to apply the previous steps while considering our scenario “sending two personalized emails, one for the customer and another for our support team”.

A deeper dive of what we did

  • Loading your sample data is an important step to make sure your data is passed down to the next steps correctly.
  • Each step passes down the output to the next step, but only after testing.
  • Using passed down data helps us create a more dynamic flow specifically crafted for our needs.

After testing, here’s what the customer support team receives from the last action in our flow:

  • Subject: Ticket #2
  • Body: Customer Osama with the email Test@activepieces.com has the following problem “Waiting too long for my food!”

Make Your Flows Easier to Manage

You can rename each step (task) in the flow to make it easier to understand what it does, especially if you are a team collaborating or if you revisit your flow in the future. Here’s how:

  • Click on the task you want to rename.
  • Press the pencil icon located on the top-right.
  • Type the new name.

The screenshot below shows my flow after renaming.

Next Up: A tour into the dashboard

In the next lesson, we will take a simple tour into the dashboard of Activepieces, I promise it will be an easier and a faster read. :relieved:

2 Likes