> ## Documentation Index
> Fetch the complete documentation index at: https://help.hoopai.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Using a query string in trigger links

> Learn how to pass data through query strings in workflow trigger links in the HoopAI platform, including syntax, dynamic values, and common mistakes.

Trigger links in the HoopAI platform allow you to start a workflow when a contact clicks a URL. By adding query string parameters to the trigger link, you can pass additional data into the workflow — such as a product name, source campaign, or custom field value.

***

## Query string syntax

A query string begins with `?` after the base trigger link URL, with each parameter formatted as `key=value`. Multiple parameters are separated by `&`.

```
https://yoursubdomain.hoopai.com/trigger/abc123?source=email&product=starter
```

| Part        | Example                                           | Purpose                             |
| ----------- | ------------------------------------------------- | ----------------------------------- |
| Base URL    | `https://yoursubdomain.hoopai.com/trigger/abc123` | The trigger link generated by Hoop  |
| `?`         | First separator                                   | Marks the start of the query string |
| `key=value` | `source=email`                                    | A single parameter                  |
| `&`         | Between parameters                                | Separates multiple parameters       |

***

## Step 1: Create a trigger link workflow

<Steps>
  <Step title="Create a new workflow">
    Go to **Automation > Workflows** in the Hoop platform and create a new workflow. Select **Trigger Link** as the workflow trigger.
  </Step>

  <Step title="Copy the trigger link URL">
    After saving the trigger, Hoop generates a unique URL. Copy this URL — it is the base URL you will append query strings to.
  </Step>

  <Step title="Append your query parameters">
    Add your parameters after the URL. For example, if your trigger link is `https://yoursubdomain.hoopai.com/trigger/abc123`, you can add `?utm_source=facebook&offer=premium` to pass those values into the workflow.
  </Step>
</Steps>

***

## Step 2: Use query string values in the workflow

<Steps>
  <Step title="Access the values in workflow actions">
    In any workflow action, you can reference query string values using the custom values picker. Look for **Trigger Link** in the values list — each query parameter you passed will be available as a selectable value.
  </Step>

  <Step title="Map values to contact fields">
    Use an **Update Contact** action to save query string values to contact custom fields. For example, map `{{trigger_link.source}}` to a custom field called "Lead Source."
  </Step>

  <Step title="Use values in conditional logic">
    Add an **If/Else** branch that checks a query string value. For example, route contacts to different follow-up sequences based on `{{trigger_link.product}}`.
  </Step>
</Steps>

<Tip>
  Name your query parameters descriptively — use `product_interest` instead of `p` so your workflow logic is easy to understand months later.
</Tip>

***

## Passing dynamic values

You can insert dynamic contact data into trigger link query strings when sending them via email or SMS from Hoop.

```
https://yoursubdomain.hoopai.com/trigger/abc123?email={{contact.email}}&name={{contact.first_name}}
```

<Note>
  Dynamic values like `{{contact.email}}` are resolved at send time. The contact receives a URL with their actual data filled in, not the placeholder text.
</Note>

***

## URL encoding

Special characters in query string values must be URL-encoded to work correctly.

| Character | Encoded form | Example                    |
| --------- | ------------ | -------------------------- |
| Space     | `%20` or `+` | `name=Jane%20Doe`          |
| `&`       | `%26`        | `company=Smith%26Co`       |
| `=`       | `%3D`        | `code=A%3D1`               |
| `@`       | `%40`        | `email=jane%40example.com` |

<Warning>
  If you do not encode special characters, your query string will break. For example, an unencoded `&` in a value will be interpreted as a parameter separator, splitting your data incorrectly.
</Warning>

***

## Common formatting mistakes

<AccordionGroup>
  <Accordion title="Using ? more than once">
    The `?` character should only appear once in the URL, right before the first parameter. Additional parameters use `&` as a separator. A URL like `?source=email?product=starter` will not parse correctly.
  </Accordion>

  <Accordion title="Spaces in parameter names or values">
    Spaces in URLs cause errors. Use `%20` or `+` for spaces in values, and avoid spaces in parameter names entirely. Use underscores instead: `product_name=starter`.
  </Accordion>

  <Accordion title="Missing values">
    A parameter like `source=` with no value will pass an empty string into your workflow. This can cause issues with conditional logic that checks for specific values. Always provide a value for each parameter.
  </Accordion>

  <Accordion title="Case sensitivity">
    Query parameter names are case-sensitive. `Source=email` and `source=email` are treated as different parameters. Be consistent with casing across your trigger links and workflow logic.
  </Accordion>
</AccordionGroup>

***

## Testing trigger links

<Steps>
  <Step title="Open the link in an incognito window">
    Paste the full trigger link with query parameters into an incognito browser window. This simulates a contact clicking the link without any cached session interfering.
  </Step>

  <Step title="Check the workflow execution log">
    After clicking the link, go to **Automation > Workflows** and open your workflow. Check the execution history to confirm the workflow was triggered and that query string values were captured correctly.
  </Step>

  <Step title="Verify contact data">
    If your workflow maps query string values to contact fields, open the contact record and confirm the fields were updated with the expected values.
  </Step>
</Steps>
