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

# Data Mapping

## Mapping HubSpot Properties to Webhook Payload

### Body Configuration (POST, PUT, PATCH)

In the Body Configuration section, use HubSpot property syntax: `{{object.property}}`. Nest properties within your JSON structure as needed.

**Example:**

```json theme={null}
{
  "contact": {
    "firstName": "{{contact.firstname}}",
    "lastName": "{{contact.lastname}}",
    "email": "{{contact.email}}"
  },
  "deal": {
    "amount": "{{deal.amount}}",
    "stage": "{{deal.dealstage}}"
  }
}
```

### Query Parameters (GET, DELETE)

In the Query Parameters section, set key-value pairs using HubSpot property syntax for dynamic values.

**Example:**

* Key: `contactId`, Value: `{{contact.id}}`
* Key: `dealAmount`, Value: `{{deal.amount}}`

Result: `?contactId=123456&dealAmount=10000`

***

## Configuring Dynamic Content Insertion

### Using Conditional Logic

Use HubSpot's syntax for conditional insertions:

```
{% if contact.company %}
  "company": "{{contact.company}}"
{% else %}
  "company": "Individual"
{% endif %}
```

### Formatting Date and Number Properties

Use HubSpot's filters to format properties:

* Date: `{{deal.closedate|date:"yyyy-MM-dd"}}`
* Number: `{{deal.amount|number:"0.00"}}`

### Handling List Properties

For properties that return lists, use indexing:

```json theme={null}
{
  "primaryContact": "{{company.contacts.name[0]}}",
  "allContacts": [
    {% for contact in company.contacts %}
      "{{contact.name}}"{% if not forloop.last %},{% endif %}
    {% endfor %}
  ]
}
```

***

## Best Practice

<Note>
  Test your data mapping thoroughly using HubSpot's workflow testing feature with various sample records to ensure all scenarios are handled correctly.
</Note>

<Tip>
  **Got unique integration needs?**\
  Our custom team can build tailored integrations, specialized data mappings, and workflow automations to perfectly match your specific business processes.

  [Advanced integration settings](https://custom.cloudify.biz/)
</Tip>
