# Dynamic URL

### &#x20;Overview

The Dynamic URL Button allows you to add personalized links to your WhatsApp templates in Squarebox. Using dynamic variables like {{1}}, you can send custom URLs to each lead — perfect for sharing lead-specific dashboards, payment links, or forms.

### &#x20;How It Works

You can use dynamic variables ({{1}}, {{2}}, etc.) inside the URL button of your WhatsApp template. When the template is sent via Campaigns, Triggers, or Automations, Squarebox will automatically replace the variable with each customer's specific data.

### &#x20;Steps to Use Dynamic URL Button

#### 1. Create or Edit a Template

Go to:\
Home → Manage Templates → New Template

1. Fill in the basic template details<br>
2. Choose "Add Button"<br>
3. Select Button Type: URL<br>

#### 2. Add the Dynamic Variable in URL

In the URL field, use variables like:

<https://yourdomain.com/lead/\\{{1\\}}>

* {{1}} will be dynamically replaced with data like lead ID, phone number, or any mapped value during template send.<br>

Example:\
If you send a campaign where {{1}} = 9988776655,\
the final button will open:

<https://yourdomain.com/lead/9988776655>

#### 3. Map Variables While Sending

When using the template in a Campaign or Trigger, Squarebox will prompt you to map the dynamic variables.

* You can select what {{1}} should contain (e.g., Phone Number, Lead ID, Custom Field).<br>

### &#x20;Use Cases

* Lead-Specific Dashboard Access:\
  Send a dashboard link with their lead ID embedded.
* Custom Payment Links:\
  Share personalized Razorpay or Stripe payment links.
* Form Submissions:\
  Direct users to fill prefilled forms tied to their profile.<br>

### Notes

* Only use dynamic variables in the URL, not in the button text.
* Avoid using personally sensitive data in the visible URL.
* Test templates with dummy values before submitting for WhatsApp approval.<br>

{% embed url="<https://youtu.be/WXCapnVszRU>" %}

<br>


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://squarebox-ai.gitbook.io/squarebox/templates/dynamic-url.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
