Sometimes you may find creating an audience in Studio easier by simply copying and pasting a list of emails into the query builder. Reasons for this can range. Here's a highlight of some common use cases:
- You want to be able to edit the list of users after creating the audience, but "import" creates a static snapshot that cannot be edited
- You want to avoid creating users
- You do not have the first and last names required for the user import file
Copy and Paste Emails into Advanced Query
All users must have an activated profile on the user's page in order for this solution to work. If your users do not have a profile on the user's page, then we cannot reach out to them.
Note that this solution requires that you have a list of the users by unique identifier, and for this article we are focusing on email. You can adapt this solution to copying and pasting other unique identifiers, just make sure to adjust the "primary_email:" string in your formula. Steps to get the code for a particular attribute are described at the end of this guide.
- Open your preferred spreadsheet software and create a new sheet.
- Enter all email addresses into Column A in your spreadsheet.
- In Column B, to the right of the first email value, enter the formula
="primary_email:"""&A2&""" OR"
. This is a concatenation that will combine specific text with the email values so that we end up withprimary_email:"employee@firstup.io" OR
for every user that you need to add to this audience.- The example assumes you enter a header in cell A1 such as "email address". The exact header does not matter for this solution. If your list has no header, your formula may say
="primary_email:"""&A1&""" OR"
.
- The example assumes you enter a header in cell A1 such as "email address". The exact header does not matter for this solution. If your list has no header, your formula may say
- Replicate the formula down Column B so that every email value is captured.
- Select and copy all values in Column B.
-
Sign into Studio, navigate to People > Audiences.
- If creating a new audience, click the + Audience button.
- If updating an existing audience, edit the audience.
- Click More and select Advanced query builder.
- Delete the asterisk (*) or any other existing text.
- Paste your copied text from Column B into the query field.
- IMPORTANT: remove the very last OR. Your query is not valid if it ends with OR.
- Enter a name and description for your audience and click Save.
Large Query Note
The Advanced Query tool is not meant for extremely large queries. If you run into timeout errors when pasting thousands of lines of text, consider splitting your query into multiple audiences. Then, you can create one master audience that refers to the smaller audiences. For example:
Audience 1 - [first half of list of emails]
Audience 2 - [second half of list of emails]
Audience 3 - audience name IS Audience 1 OR audience name IS Audience 2
Troubleshoot Query
If you are having issues with your query being detected as valid, check the following:
- All caps "OR" between all email values
primary_email:rachel.king@firstup.io OR primary_email:angela.frey@firstup.io
- Confirm there is no trailing OR at the end of the last formula. See step #10 above.
- Make sure there are no single quotes such as
primary_email:'rachel.king@firstup.io'
.- Either omit quotation marks or use double quotation marks such as
primary_email:"rachel.king@firstup.io"
.
- Either omit quotation marks or use double quotation marks such as
-
Remove any leading spaces, e.g.
primary_email: "angela.frey@firstup.io"
.-
The correct format would be
primary_email:"angela.frey@firstup.io"
.
-
The correct format would be
Different Attributes
The steps above focus on adding users based on their email address. However the method above can be used for any user attribute.
To get the query code for any attribute:
- Create a new audience. There is no need to save this audience.
- Add the attribute that you are interested in using and select any item for that attribute.
- Switch to the advanced query builder.
- Copy the attribute code from the query. Use this in place of "primary_email" in the steps above,
Comments
0 comments
Article is closed for comments.