A placeholder is a special tag that you can insert into your connector configuration, which gets replaced with a dynamic value when the connector is used. Think of them as variables for your connector.
Placeholders are essential for building powerful connectors because most API requests require dynamic information. For example, you might need to:
Fetch data for a specific date range selected by the user.
Include a user's secret access token in an authentication header.
Pass a list of specific metrics and dimensions the user selected as part of the request.
Placeholders solve this problem by acting as a stand-in for that information. When a user uses the connector (meaning that the user authenticates or runs a query), all the placeholders defined in the connector get replaced with the correct, up-to-the-minute values.
A Simple Example: Dynamic Date Ranges
Let's say you're building a connector and the API requires a URL with start and end dates, like this: https://api.example.com/data?start=2025-01-01&end=2025-01-31
This URL is static. It will only ever fetch data for January 2025.
To make it dynamic, you can use date placeholders. You would write the URL in the connector configuration like this: https://api.example.com/data?start={{query.start_date.date}}&end={{query.end_date.date}}
Now, when a user selects a date range for their query in Supermetrics, the {{query.start_date.date}} and {{query.end_date.date}} placeholders will be automatically replaced with the selected dates. For example, if the user chose to fetch data for all of June 2025, the connector will automatically build the correct URL: https://api.example.com/data?start=2025-06-01&end=2025-06-30.
Using placeholders
The syntax is simple. Just wrap the placeholder's name in double curly braces, like {{placeholder_name}}. There is a pre-defined list of placeholders available, which you’ll find below.
Placeholders can be used within request URLs, or as request header, body, or parameter values.
Available Placeholders
Placeholders are grouped into several categories based on the type of information they provide.
User input placeholders
User input placeholders allow you to use values the user has input during the authentication flow.
Placeholder | Description |
|---|---|
| Input fields in the authentication flow. The asterisk is replaced by the ID of the input field. For example, for input field with ID |
OAuth2 placeholders
OAuth2 placeholders are dedicated to the OAuth2 authentication type and make configuring OAuth2 authentication easier.
Placeholder | Description |
|---|---|
| Client ID for OAuth2. Gets the value defined in the |
| Client secret for OAuth2. Gets the value defined in the |
| The callback URL you’re going to need for OAuth2 authentication. This will always return If you need to have the callback URL with a trailing slash, you can use this format |
| The OAuth2 code used in the token exchange. |
| The refresh token used when the OAuth2 token is refreshed. |
| The state string for OAuth2 flow. |
Data source user placeholders
Data source user placeholders allow you to use values and properties configured to be stored in the data source user component.
Placeholder | Description |
|---|---|
| Access token for the selected connection. |
| Base64 encoded string of |
| If you have defined additional properties in data source user component, you can use them via a placeholder by replacing the asterisk with any data source user property ID. NOTE: Currently unsupported in OAuth2 authentication |
Account placeholders
Account placeholders allow you to use values and properties from accounts fetched via account fetchers.
Placeholder | Description |
|---|---|
| ID of the currently used account. |
| Parent account ID of the currently used subaccount. |
| If you have defined additional properties in the accounts component, you can use them via placeholders by replacing the asterisk with any account property ID. |
Query placeholders
Query-related placeholders allow you to use values selected by the user when building a query in Supermetrics. These include, for example, the start or end date selected for the query, the fields selected for the query, or the options selected for the query.
Placeholder | Description |
|---|---|
| Start and end date user selected for the query in the Supermetrics product. The asterisk Available formats:
|
| The value the user selected for the setting when building a query in the Supermetrics product. The asterisk |
| IDs of all the fields (metrics and dimensions) the user selected when building a query in Supermetrics products, as a comma-separated string. For example: |
| IDs of all the fields (metrics and dimensions) the user selected when building a query in Supermetrics products as a space-separated string. For example: |
| IDs of all the dimensions the user selected when building a query in Supermetrics products as a comma-separated string. For example: |
| IDs of all the dimensions the user selected when building a query in Supermetrics products as a space-separated string. For example: |
| IDs of all the metrics the user selected when building a query in Supermetrics products as a comma-separated string. For example: |
| IDs of all the metrics the user selected when building a query in Supermetrics products as a space-separated string. For example: |
Asynchronous request flow placeholders
Async placeholders are used when configuring asynchronous request flow to use the report ID received during the initial report generation request when polling for status, and to use the endpoint/URL to get final results received from polling.
Placeholder | Description |
|---|---|
| The value received as a response from the initial reporting request ( Replace the asterisk |
| The value received as a response from the polling step ( Replace the asterisk |
Placeholder operations
Placeholder operations are used to modify values given to them.
For example, if you want to subtract the first 5 characters from a username that the user provided as input during the authentication flow, you can add a placeholder operation around the placeholder to do so. The configuration would look like this: {{subst(inputs.username,0,5)
You can find all available operations and their explanation for the parameters below.
Using static strings in placeholder operations
You can also use static string values within placeholder operations where you need to. Static values can be included within operations by wrapping them in single quotes ' .
For example, if you want to use base64 encoded values of username and password stored in the data source users, and those should be separated by a semicolon :, the configuration would look like this: {{base64(user.properties.username,’:’,user.properties.password)}} .
Available operations
Operation | Description |
|---|---|
|
Example:
|
|
Example:
|
| Returns a formatted string according to the provided
If If Examples
|
| Returns a globally unique string - identifier. It’s usually used to identify and distinguish each connection, or the User ID field of user info object when data source doesn't provide a suitable or secure one that can be exposed publicly. Example
|
| Returns one value ( Empty argument is considered to be:
Example
|
|
Example
|
|
Example
|
| Returns current timestamp. Example
|
|
If
Example
|
| Formats an array as a string containing an array of strings: If the passed parameter is not an array but a scalar value, like Example
|
| Returns |
| Creates a formatted time string based on the input time string.
Example |
| Replace all occurrences of the search string with the replacement string Example
|
| URL-encodes string. It calls the PHP function urlencode() for doing that. Example
|
| Split the string by the separator to an Note: The elements count starts from Example
|
|
Accepted argument types:
Any other argument types will be ignored. Example:
|
|
Example
Given |
|
Example
Given |