Add a connection label
Zapier users can authenticate multiple accounts for any app. By default, every new app account added to Zapier is identified by the app’s name, followed by a number (#2, #3, …) for accounts connected after the first.
A connection label in the integration authentication options adds optional text as the name of each account connection to help users distinguish between their authenticated accounts.
Prerequisites
- A configured authentication scheme in the Platform UI
Steps
-
Enter your desired value into the Connection Label field in the authentication configuration, as the name of the field, surrounded by double curly braces
-
Zapier always includes the app’s name in each account label, so it is redundant to add any hard coded app name into your connection label.
-
Instead, add either:
-
Data that users enter in the authentication form
-
Output fields from your app’s authentication test API call
For example, if your auth configuration includes a
username
field, your connection label could look like:{{username}}
Alternatively, you can use an output field from your test API call in the Connection Label. If you aren’t sure what fields will be returned, you’ll want to test your authentication first, and return to the connection label.
After connecting an account, check the Response tab to see the fields returned from the test request.
-
-
Field keys from the authentication form and the test request are both pulled up to the top level.
You can also refer to the fields with
{{bundle.authData.field}}
for input fields from the authentication form, replacingfield
with your input field key. Use{{bundle.inputData.field}}
for fields returned from the test request, replacingfield
with the field key from the API response.If you need to use a nested field from your API call results, reference it as
field.nestedfield
. For example, if your test API response includes aname
field nested underdetails
, you would reference it as:{{bundle.inputData.details.name}}
Any field your authentication test API call returns can be used in the connection label. The best fields to use are usernames, domain names (if your app is self-hosted), account numbers, email addresses, or other identifiable but not fully private data. Never use passwords, API keys, or other critical, private info in connection labels.
-
Customize your connection label further with JavaScript code as needed.
Custom code for connection labels is best used for:
-
Using code to manipulate data from an auth or test call before using it in a connection label, such as to format a number or date
-
Logging additional data
-
Making a new API call to access data to use in the connection label
Select Edit Code to switch to [Code Mode](link to https://coda.io/d/Overhaul-platform-docs_dRIxVbcnE_L/Use-Code-Mode-to-refine-your-API-call_suwCV#_luwtY). When_Code Mode_ is enabled, Zapier will only use the code to create your connection label, and will ignore any text that was in the Connection Label field in the regular string mode.
To switch back to the regular string field, click the Delete Code button to delete your custom connection label code and revert to using the text entered in the Connection Label field.
When writing code for the connection label, fields are not pulled up to the top level of the
bundle
object - usebundle.authData
for auth input fields, orbundle.inputData
for fields returned from the test API request. For example, your code might look like this: -
Need help? Tell us about your problem and we’ll connect you with the right resource or contact support.