> ## Content Index
> Fetch the complete content index at: https://internalnote.com/llms.txt
> Use this file to discover other available public pages before exploring further.

# Update a requester name via webhooks and custom fields
- URL: https://internalnote.com/update-a-requester-name-via-webhooks-and-custom-fields/
- Published: 2022-11-14T11:14:00.000Z
- Updated: 2024-08-19T20:38:11.000Z
- Description: Update a requesters' profile based on form field input.
- Author: Thomas Verschoren
- Tags: Platform

When an end-users submits a ticket via email Zendesk has a pretty good parser that extracts their name from the email header. Similar within Messaging and Flow Builder we can ask the customer for their name before we escalate to an agent.

But traditional Help Center forms do not offer a name field. Customers can enter their email and Zendesk tries to find a name to assign to the user.  
Email addresses like *john@domain.com* or *john.mcclane@nakatomi.com* are easily parsed. But *jappleseed@domain.com* is not as easy. Even worse is *banana@company.com.*

We can fix this issue by leveraging custom fields and webhooks.

## **The Setup**

1. Add an `Your name` field to your webforms.
2. Create a Webhook that updates the ticket requester.
3. Have a Trigger for created tickets that calls the Webhook for Web form tickets.

### **Create a custom field**

Create a Custom Field of type textfield called ‘Your name’ that is available to end-users.

Note down its ID, e.g. `123456789`

Add the Custom Field to your forms, preferably right above the Subject field so it appears beneath the default email field for new users.

![](https://storage.ghost.io/c/ca/c0/cac0c82b-bc4d-4404-9eb4-9cc75e8d045e/content/images/2023/01/Screenshot-2022-11-14-at-14.17.18.png)

![](https://storage.ghost.io/c/ca/c0/cac0c82b-bc4d-4404-9eb4-9cc75e8d045e/content/images/2023/01/Screenshot-2022-11-14-at-14.17.22.png)

### **Create a webhook**

Make sure you have an [API Token](https://support.zendesk.com/hc/en-us/articles/4408889192858-Generating-a-new-API-token?ref=internalnote.com) ready to use.

Create a new webhook with the following criteria:

- Name: Update Requester Name
- Endpoint URL: `https://yourdomain.zendesk.com/api/v2/users/{{ticket.requester.id}}.json?user[name]={{ticket.ticket_field_123456789}}` where `123456789` is the ID of the created ticket field
- Type: PUT
- Payload: JSON
- Authentication: Basic Authentication `admin@company.com/token` and your Zendesk Token. Use the email of a valid Zendesk Administrator in your instance.

![](https://storage.ghost.io/c/ca/c0/cac0c82b-bc4d-4404-9eb4-9cc75e8d045e/content/images/2023/01/2a.png)

![](https://storage.ghost.io/c/ca/c0/cac0c82b-bc4d-4404-9eb4-9cc75e8d045e/content/images/2023/01/2b.png)

![](https://storage.ghost.io/c/ca/c0/cac0c82b-bc4d-4404-9eb4-9cc75e8d045e/content/images/2023/01/2c.png)

### **Create a trigger**

Create a new trigger with the following criteria:

- `Ticket` is created
- `Your Name` is present
- `Channel` is Web form

As actions choose: Notify Webhook and choose the webhook you just created. Leave the settings as is.

![](https://storage.ghost.io/c/ca/c0/cac0c82b-bc4d-4404-9eb4-9cc75e8d045e/content/images/2023/01/3a.png)

![](https://storage.ghost.io/c/ca/c0/cac0c82b-bc4d-4404-9eb4-9cc75e8d045e/content/images/2023/01/3b.png)

You’ve now setup a flow where each time an user fills in the Web form, we update their name with whatever value they provided in the ticket field.

![](https://storage.ghost.io/c/ca/c0/cac0c82b-bc4d-4404-9eb4-9cc75e8d045e/content/images/2023/01/4a.png)

![](https://storage.ghost.io/c/ca/c0/cac0c82b-bc4d-4404-9eb4-9cc75e8d045e/content/images/2023/01/4b.png)

![](https://storage.ghost.io/c/ca/c0/cac0c82b-bc4d-4404-9eb4-9cc75e8d045e/content/images/2023/01/4c.png)

## **Expanding on this concept**

This Webhook flow allows for a lot more customisation. Instead of passing only a name you could pass a full JSON payload with more metadata you wish to upload to an end-users profile:

Imagine a form with 3 custom fields:

1. Your name - ID 123
2. Title - ID 456
3. Location - ID 789

And you have 2 user fields `job_title` and `location` .

You can then create a Webhook with Endpoint URL `https://yourdomain.zendesk.com/api/v2/users/{{ticket.requester.id}}.json`

In the Trigger you edit the JSON Payload as follows :

```json
{ "user": 
	{ 
		"name": "{{ticket.ticket_field_123}}", 
		"user_fields": { 
			"job_title": "{{ticket.ticket_field_456}}", 
			"location": "{{ticket.ticket_field_789}"} 
		}
	}
}
```

Whenever a user now submits a ticket with the name, title and location fields filled in, our Trigger will update their profile to show this new information.