Quickbase Discussions

 View Only

Generate template records with Pipelines

By Brian Cafferelli posted 02-21-2020 12:49

  

Generate template records with Pipelines


One of the main ways Quickbase helps companies perfect their unique processes is by automating routine work. This saves time, improves your employees’ morale, and reduces risk for your business. A common automation pattern we see from our customers is generating a set of template child records when a new parent record is created. If you’ve been building apps in Quickbase for a while, you may know this as the “Copy Master and Details Records” technique. You can generate template records easily using Pipelines.
Pipelines is an exciting technology that makes it easier than ever for you to automate your workflow, even across your ecosystem of software tools. Read on to learn how you can use Pipelines to generate a set of template child records.

Table of Contents

• Example use case: managing marketing campaigns
• Creating a template table
• Overview of example pipeline
• Creating a new pipeline
• Step A: Setting up the trigger
• Setting up the email condition
• Step B: Searching the template table for email activities
• Step C: Generating the activities for email campaigns
• Setting up the social media condition
• Step D: Searching the template table for social media activities
• Step E: Generating the activities for social media campaigns

Example use case: managing marketing campaigns

Automatically generating a set of template child records isn’t limited to specific industries or use cases. However, for the sake of simplicity we’ll focus on a specific example to walk through the process. Imagine that your company manages marketing campaigns in Quickbase. There are many types of campaigns, and each campaign uses a different marketing channel. For example, let’s say the company often uses email and social media for its campaigns. Each type of campaign has a standard list of activities. Rather than create the same types of activities over and over, you can use Pipelines to automatically create the activities.

Creating a template table

Next, you need to decide how to manage your list of standard activities. The most scalable way of doing this is to have one table for your live activity data and a separate table for your template activities. Note that the Activity Templates table doesn’t need to be related to your other tables.


TIP: If you didn’t already have an Activity Templates table in your app, open the Activities table and click More > Copy
table. You can copy the table without data and name the new table “Activity Templates”.

You may want to hide the templates table from your users, since they won’t need to interact with it directly. (To do this, go to the Activity Templates table > click the gear > click Advanced Settings > scroll to the bottom and uncheck “Show in the table bar”).

Finally, the Activity Templates table needs a field to mark which channel each activity is for. In this example, a Text – Multiple Choice field called Channel keeps track of that.

Overview of example pipeline

Before creating the pipeline, let’s take a look at what the finished product will look like. The pipeline will have the following steps:

- Step A: Record Created – triggers the pipeline when a new campaign is created
- 1st Condition - If the new campaign record has Channel = Email, then
-- Step B: Search Records – search the Activity Templates for email activities, and for each matching template, then
----Step C: Create Record – add an activity record using data from the activity template
- 2nd Condition – If the new campaign record has Channel = Social Media, then
--Step D: Search Records - search the Activity Templates for social media activities, and for each matching template, then
----Step E: Create Record – add an activity record using data from the activity template



Creating a new pipeline

Since pipelines can work across Quickbase apps, you access pipelines from the app bar.



Before you start building the pipeline, keep in mind that your example company uses email and social media for your marketing campaigns. You have a standard list of activities for each of those two types of campaigns. Here’s how to get started building your pipeline:

1. On the My Pipelines page, click Create pipeline.
2. In the pop-up window that appears, name the pipeline. For this example, call it “Marketing Campaign Manager: Create campaign activities”. All pipelines you create appear in a single list, across all applications you manage. Including the name of the Quickbase app in the pipeline name helps you to keep things organized.
3. It’s a best practice to write a few sentences for the description to explain what actions the pipeline will be taking.
4. Click Create pipeline.
5. Click the Quickbase channel in the list of channels.
6. Connect to your Quickbase account if you have not already done so (click here to learn how).
Next you need to create the trigger step, to determine when the pipeline will run.

Step A: Setting up the trigger

The goal of this step is to create the right set of activities when a new marketing campaign is added.



Here’s how to set it up:
1. Click the Records category.
2. Click the Record Created trigger and drag it to the dotted box on the canvas.
2. Under Table, select the Campaigns table.
3. Under Fields for Subsequent Steps, select Channel.

Setting up the email condition

Next, we need to add a condition for email campaigns.



Here’s how to set it up:
1. Click Insert a condition below Step A. A few new branches appear - for If, Then, and Else.
2. Under If, click Add Conditions.
3. Select Channel.
4. In the dropdown next to Channel, select is.
5. In the box below, select Email.

Step B: Searching the template table for email activities

The goal of this step is to find the list of standard activities needed for email marketing campaigns.



Here’s how to set it up:
1. Click and drag the Search Records action from the Quickbase channel, below the Then box.
2. Click in the Account box and select the same user token used in the trigger step. In this example, that would be “Marketing campaign manager token”.
3. Click in the Table box and select “Activity Templates”.
4. Under Fields, select Channel, Activity Name, and Assigned To.
5. Click Add conditions.
6. Select Channel.
7. Next to Channel, select equals from the dropdown.
8. In the box below, enter Email.

Step C: Generating the activities for email campaigns


The goal of this step is generate the activities for email campaigns.

Here's how to set it up:
1. Under the Do box, drag the Create Record step onto the canvas as Step C.
2. Click in the Account box and select the same user token used above. In this example, that would be “Marketing campaign manager token”.
3. Click in the Table box and select “Activities”.
4. Select the fields to specify values: Activity Name, Assigned To, and Related Campaign.
5. In the field list in the middle of the page, find Email under Assigned To and drag it into the Assigned To box on the left. As you would do when importing a spreadsheet into a User-type field, in pipelines you also use email addresses to populate User fields.
6. Drag Activity Name from the list in the middle to the box on the left.



7. In the field list in the middle of the page, click A to switch to a list of fields from the campaign record that triggered this pipeline.



8. Drag Record ID from the list to the Related Campaign box on the left. This will relate the new activity records to the campaign record.

Setting up the social media condition

This pipeline will handle both email campaigns and social media campaigns. So the next step is to create the condition that the campaign which triggered this pipeline is a social media campaign.



Here’s how to set it up:

1. Outside of the Else branch, click Insert a condition. A few new branches appear - for If, Then, and Else.

TIP: There are a few different places you can insert conditions. For this type of pipeline, your condition steps should be one beneath the other, as you see below. The conditions should not be indented as part of a Then or Else branch.



2. Under If, click Add Conditions.
3. Select Channel.
4. In the dropdown next to Channel, select is.
5. In the box below, select Social Media.

Step D: Searching the template table for social media activities

The goal of this step is to find the list of standard activities needed for social media marketing campaigns.



Here’s how to set it up:
1. Click and drag the Search Records action from the Quickbase channel, under the Then box of the condition we just created above.
2. Click in the Account box and select the same user token used in the trigger step. In this example, that would be “Marketing campaign manager token”.
3. Click in the Table box and select “Activity Templates”.
4. Under Fields, select Channel, Activity Name, and Assigned To.
5. Click Add conditions.
6. Select Channel.
7. Next to Channel, select equals from the dropdown.
8. In the box below, enter Social Media.

TIP: To easily navigate around the Pipeline Builder, use the toggle in the top-right of a step to expand or collapse it.



Step E: Generating the activities for social media campaigns

The goal of this step is to generate the activities for social media campaigns.

Here's how to set it up:
1. Under the Do box, drag the Create Record step onto the canvas as Step E.
2. Click in the Account box and select the same user token used above. In this example, that would be “Marketing campaign manager token”.
3. Click in the Table box and select “Activities”.
4. Select the fields to specify values: Activity Name, Assigned To, and Related Campaign.
5. In the field list in the middle of the page, find Email under Assigned To and drag it into the Assigned To box on the left. As you would do when importing a spreadsheet into a User-type field, in pipelines you also use email addresses to populate User fields.
6. Drag Activity Name from the list in the middle to the box on the left.
7. In the field list in the middle of the page, click A to switch to a list of fields from the campaign record that triggered this pipeline.
8. Drag Record ID from the list to the Related Campaign box on the left.

Permalink