Using Variables - Building - Carrd docs

Using Variables
Requires Pro Plus or higher
Variables make it possible to incorporate dynamic content into a site's text, link URLs, form values, and more. A variable is generally made up of a name and an optional fallback value:
{{name|fallback}}
The name portion of the variable is the unique name associated with the content (or value) you're trying to include, while the fallback portion is an optional fallback in case the value is blank or the variable doesn't exist. For example, the variable {{url.name}} in the following line of text:
Welcome, {{url.first_name}}!
... will be expanded to the value of url.first_name, which in this case is the first_name URL parameter:
Welcome, Cayce!
Similarly, the variable {{url.first_name|friend}} will also be expanded to the contents of the first_name URL parameter, but if it's blank or doesn't exist it'll instead be expanded to the fallback value friend:
Welcome, friend!
Supported Variables
Below is a list of all variables currently supported by Carrd. Variables with a Global scope can be used anywhere variables are supported. All other variables can only be used within their defined scopes.
Some variables require a user interaction before they can expand. For example, form variables such as
{{email}},{{form01.email}}, or{{form01_response.confirmation_id}}will only expand after the user has submitted that specific form.
| Scope | Variable | Description |
|---|---|---|
| Global | {{url.parameter_name}} | Contents of the parameter_name URL parameter. Common uses include appending UTM parameters (such as utm_source and utm_medium) to outgoing links, and dynamically populating form fields with default values. |
| Global | {{client.date}} | Client's local date in numeric format (e.g., 1/3/22). |
| Global | {{client.time}} | Client's local time in HH:MM format (e.g., 12:34 PM). |
| Global | {{client.fulldate}} | Client's local date in string format (e.g., January 3, 2022). |
| Global | {{client.fulltime}} | Client's local time in HH:MM:SS format (e.g., 12:34:56 PM). |
| Global | {{client.timestamp}} | Alias of client.utc_timestamp. |
| Global | {{client.utc_date}} | UTC date in numeric format (e.g., 1/3/22). |
| Global | {{client.utc_time}} | UTC time in HH:MM format (e.g., 12:34 PM). |
| Global | {{client.utc_fulldate}} | UTC date in string format (e.g., January 3, 2022). |
| Global | {{client.utc_fulltime}} | UTC time in HH:MM:SS format (e.g., 12:34:56 PM). |
| Global | {{client.utc_timestamp}} | UTC time as a Unix timestamp (e.g., 1641213240). |
| Global | {{form.fieldId}} | Expands to the value of the last submitted form's fieldId field. Requires Export variables to be enabled on the form. |
| Global | {{form_response.key}} | Expands to the value of key from the last submitted form's most recent endpoint response. Requires both Export variables and Return endpoint responses to be enabled on the form. Responses with multilevel keys are automatically flattened. |
Contact Form
| Variable | Description |
|---|---|
{{name}} | Value of this form's Name field. |
{{email}} | Value of this form's Email field. |
{{message}} | Value of this form's Message field. |
{{company}} | Value of this form's Company Name field. |
{{phone}} | Value of this form's Phone Number field. |
{{subject}} | Value of this form's Subject field. |
{{consent}} | Value of this form's Require Consent field. |
Signup Form
| Variable | Description |
|---|---|
{{email}} | Value of this form's Email field. |
{{fname}} | Value of this form's First Name field (or Name field if using a single name field). |
{{lname}} | Value of this form's Last Name field. |
{{company}} | Value of this form's Company Name field. |
{{phone}} | Value of this form's Phone Number field. |
{{consent}} | Value of this form's Require Consent field. |
Custom Form
| Variable | Description |
|---|---|
{{fieldId}} | Value of this form's fieldId field. |
Supported Elements
Variables are currently supported by the following elements:
| Element Type | Where |
|---|---|
| Buttons | Labels, Link URLs |
| Embed | Code |
| Form | Button labels, "On Complete" messages, URLs, and code, "On Success" messages, URLs, and code, "On Failure" messages, URLs, and code, "On Submit" event code, "On Success" event code, "On Failure" event code, (Custom) Input values, (Custom) Input labels |
| Gallery | Alternate Text, Captions, Link URLs |
| Icons | Link URLs |
| Image | Alternate Text, Link URLs |
| Links | Labels, Link URLs |
| List | Items |
| Table | Headings, Rows |
| Text | Content |