Create Bionic Query to Send Emails to One User
This article reviews the steps to create a Bionic Query which will send emails to a single user’s email regarding Sponsor Tracking Changes via Advanced Outreaches. It's also possible to use this setup as a template for other forms of internal outreaches via AO.
Prerequisite Knowledge
Before you begin building this in Gainsight, it is helpful to know the following:
- Be familiar with building Advanced Outreaches and using AO Bionic Query
- Data Familiarity is a must.
Bionic Query Setup
First Task
As this doc will use Sponsor Tracking changes as an example, we’ll start with creating that query as the first task. Here we are pulling Sponsor Tracking changes from Yesterday.
- In your Bionic rule, add the following fields to Show:
- SponsorTrackingHistory:Account
- SponsorTrackingHistory:Account Name
- SponsorTrackingHistory:Contact
- SponsorTrackingHistory:Contact Name
- SponsorTrackingHistory:ChangedAttribute
- SponsorTrackingHistory:Create Date
2. In Filters, set up the following filters:
(A AND B)
- SponsorTrackingHistory:Created Date >= Subtract N Days from Rule Date 1
- SponsorTrackingHistory:Created Date < Rule Date
Second Task
Next, we filter for the user email we would like to send to. In this example, we want all changes regarding Sponsor Changes to be sent to Jim. The User object is included in Show, as well as uncheck “Apply to Gainsight Customers Only”.
Third Task and Fourth Task
In order to apply the same email to each row sourced from the Sponsor Change task, we’ll add a generic join field to both the “First” & “Second” Task. To do that, we’ll take advantage of the Bionic Transformation Task's Concat function.
In the below example, all source fields are added along with the generic join field. The same should be repeated for the First & Second Task.
To create the join field, click +Formula Field > Function > Concat > Type “Join” > Enter > Type “Item” > Enter.
Fifth Task
In this task, we’ll merge the “Third” and “Fourth” Task which should be transformation tasks with the generic join field. The fifth task is the last task in this bionic query.
Uniqueness Criteria Setup
The example Uniqueness Criteria setup below picks up one email per Contact ID tied to the Sponsor Tracking change. For example, if yesterday there were three record changes to Sponsor Tracking, only one email will be sent if the Contact ID is the same on all three records. You can play with the Uniqueness Criteria for a different effect.
Also in this setup, the Participant will be re-added regardless of its status on a Scheduled Bionic Query. This means if Sponsor changes are found for the same Contact each day, regardless of Participant Status, add them again to AO and send them an email.
The below example image includes the minimum set up for “Mapping Participant Sources”. After saving this step, the app will prompt you to sync participants, so you can then review participants who meet the Bionic Query Criteria.