# Extracting variable data from WA tempate

**URL:** <https://community.yellow.ai/t/extracting-variable-data-from-wa-tempate/4989>\
**Category:** Engage\
**Tags:** templates, notification-api\
**Created:** [March 2, 2024, 4:25am UTC](https://community.yellow.ai/t/extracting-variable-data-from-wa-tempate/4989 "2024-03-02T04:25:03Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![Yogesh\_M](https://yyz1.discourse-cdn.com/flex035/user_avatar/community.yellow.ai/yogesh_m/32/3185_2.png) [@Yogesh\_M](https://community.yellow.ai/u/Yogesh_M)\
**Post date:** [March 2, 2024, 4:25am UTC](https://community.yellow.ai/t/extracting-variable-data-from-wa-tempate/4989/1 "2024-03-02T04:25:03Z")

</div>

Hello, we have a use case where we send a whatsapp template (which has varaible data) to user , and on clicking the quick reply button , we want to start a journey and use some of the data in the templates in setting some journey variables. Could you please let me know how to achieve this?

---

<div class="post-metadata">

**Author:** ![Kanchepalli\_Harsha\_V](https://yyz1.discourse-cdn.com/flex035/user_avatar/community.yellow.ai/kanchepalli_harsha_v/32/2521_2.png) [@Kanchepalli\_Harsha\_V](https://community.yellow.ai/u/Kanchepalli_Harsha_V)\
**Post date:** [March 4, 2024, 7:17am UTC](https://community.yellow.ai/t/extracting-variable-data-from-wa-tempate/4989/2 "2024-03-04T07:17:26Z")

</div>

You can use [Trigger Journey](http://localhost:3000/docs/platform_concepts/engagement/outbound/templates/whatsapptemplate#trigger-journey) CTA to trigger a journey when a user clicks on a quick reply.

You can use variables that are already stored in the DB. Can you elaborate your use case here?

---

<div class="post-metadata">

**Author:** ![Yogesh\_M](https://yyz1.discourse-cdn.com/flex035/user_avatar/community.yellow.ai/yogesh_m/32/3185_2.png) [@Yogesh\_M](https://community.yellow.ai/u/Yogesh_M)\
**Post date:** [March 4, 2024, 8:46am UTC](https://community.yellow.ai/t/extracting-variable-data-from-wa-tempate/4989/3 "2024-03-04T08:46:04Z")

</div>

Hi @Kanchepalli_Harsha_V , thanks for the response.

In our case we are using the chat bot to approve some of the internal requests and we have many request types.  
So, we send the templates with variable data to user via Notification API, when ever a request is assigned to a user.  
So we need to capture the template\_id and variable data the sent in the template, and the user action on the template’s Quick Reply buttons , and hit our end point with the following data:

- user’s phone(am aware that we can get it from bot variables),
- template\_id(we have different templates for different requests)
- request\_id(this is one of the variable data that we send in the templates)  
I am currently seeking help to retrieve the data sent in the template.  
It would also be very much helpful, if we could get into a call regarding this , so that I could explain my use case fully.

Thanks,  
Yogesh.

---

<div class="post-metadata">

**Author:** ![Kanchepalli\_Harsha\_V](https://yyz1.discourse-cdn.com/flex035/user_avatar/community.yellow.ai/kanchepalli_harsha_v/32/2521_2.png) [@Kanchepalli\_Harsha\_V](https://community.yellow.ai/u/Kanchepalli_Harsha_V)\
**Post date:** [March 5, 2024, 7:44am UTC](https://community.yellow.ai/t/extracting-variable-data-from-wa-tempate/4989/4 "2024-03-05T07:44:46Z")

</div>

To capture the data sent in the template, on Quick Reply buttons, you can utilize the quick reply event. This event will provide you with access to the event data (`{{data.event.data}}`), event name (`{{data.event.templateName}}), and sender ID (`{{sender}}`).

To capture additional details, you can send data through the `config` object as custom payload. You can pass up to three variables using the `customPayload` field.

For example:

```json
{
    "userDetails": {
        "number": ""
    },
    "notification": {
        "type": "whatsapp",
        "sender": "917888000000",
        "templateId": "order_out_for_delivery_prepaid_copy",
        "params": {
            "orderId":"1234",
            "quickReplies": {
                "ctaUrlParam": "order?order_id=2392409"
            }
        }
    },
    "config": {
        "customPayload": {
            "waybill": "15893217051240",
            "cp_id": "4",
            "account_code": "Delhivery Express"
        }
    }
}

```

To capture this data, you can use the following syntax:

```handlebars
{{{data.event.extraParams.customPayload.waybill}}}

```

This will enable you to access the waybill variable sent in the template.

---

<div class="post-metadata">

**Author:** ![Yogesh\_M](https://yyz1.discourse-cdn.com/flex035/user_avatar/community.yellow.ai/yogesh_m/32/3185_2.png) [@Yogesh\_M](https://community.yellow.ai/u/Yogesh_M)\
**Post date:** [March 5, 2024, 12:09pm UTC](https://community.yellow.ai/t/extracting-variable-data-from-wa-tempate/4989/5 "2024-03-05T12:09:10Z")

</div>

Hi @Kanchepalli_Harsha_V ,

Thank you so much, this solves my use case here.  
Unable to access, the “params” key though, sending variables required in customPayload.

---

<div class="post-metadata">

**Author:** ![Kanchepalli\_Harsha\_V](https://yyz1.discourse-cdn.com/flex035/user_avatar/community.yellow.ai/kanchepalli_harsha_v/32/2521_2.png) [@Kanchepalli\_Harsha\_V](https://community.yellow.ai/u/Kanchepalli_Harsha_V)\
**Post date:** [March 8, 2024, 7:28am UTC](https://community.yellow.ai/t/extracting-variable-data-from-wa-tempate/4989/6 "2024-03-08T07:28:40Z")

</div>

> [@Kanchepalli\_Harsha\_V](#):
>
> ```auto
> "customPayload": {
> "waybill": "15893217051240",
> "cp_id": "4",
> "account_code": "Delhivery Express"
> 
> ```

Hi,  
As mentioned, you can access `number `, `sender ` and `templateId ` and params in customPayload
