# Salesforce Custom Field Mappings

Map Salesforce record fields to PagerDuty incident custom fields so values sync bidirectionally between the two systems.

The Salesforce Custom Field Mappings feature allows you to define field-level mapping between Salesforce fields and PagerDuty incident [Custom Fields](/incident-management/incidents/custom-fields-on-incidents) of the same data type. When you map fields, the options for single and Multi-Select fields and other standard values will sync bidirectionally. You can then [link a PagerDuty incident to a Salesforce record](/integrations/salesforce-service-cloud-integration-guide/salesforce-service-cloud-user-guide#create-or-link-incidents), allowing custom field data to sync bidirectionally.

Custom Fields defined as part of the integration will count towards the account’s limits for custom fields. For more information, please see our [Custom Fields on Incidents](/incident-management/incidents/custom-fields-on-incidents) article.

> **Availability:** Salesforce Custom Field Mappings are available on the Enterprise Customer Service pricing plan. Please contact our [Sales Team](https://www.pagerduty.com/contact-us/#contact-sales) to upgrade to an account plan with this feature.

> **Requirements:** - **In PagerDuty**: Only Global Admins and the Account Owner on Enterprise Customer Service licenses can create, edit, and delete custom fields.
> - Salesforce Custom Fields Mappings is only available from the [Salesforce Service Cloud integration version v3.19](/integrations/salesforce-service-cloud-integration-guide#upgrade-to-v319) .

## Activate Custom Field Mappings

1. In Salesforce, navigate to the **PagerDuty Configuration** page.
2. Select the **Custom Field Mappings** tab.
3. Click the **Go to PagerDuty** button to start mapping Salesforce fields with PagerDuty custom fields.

## Create Custom Field Mappings

> **Restrictions:** You cannot map multiple Salesforce Record Fields to one PagerDuty custom field, or multiple custom fields to one Salesforce Record Field.

1. In PagerDuty, navigate to **Integrations**  →  **Extensions**  →  click **Edit** on the **Salesforce** extension tile  →  **Select Accounts**  →  **Custom Fields Mapping**.
2. Click **New Mapping** in the top right.
3. **Select a Salesforce field** (Required): Select your preferred **Salesforce field** from the dropdown. We will only fetch Salesforce fields that match the approved field types.
4. There are two options for creating a custom field mapping:
   1. **Map an Existing Custom Field**: Select the existing **Custom Field** that you’d like to map to the selected Salesforce field. **Note**: We will only show PagerDuty fields that are of a compatible field type to the Salesforce field.
   2. **Create and Map a New Custom Field**: Click **New PagerDuty Custom Field** to create a new PagerDuty field to map the Salesforce field. Enter the following information:
      1. **Display Name**: This will be prefilled with the Salesforce field name; change as needed.
      2. **Field Name**: This will be prefilled with the Salesforce field name; change as needed.
      3. **Description** (Optional): Enter an optional description.
      4. The **field type** will be auto-selected based on the selected salesforce field.
      5. **Set a default value** (Optional): Set a default value for the new custom field.
5. Review the mapping and then click **Save**.

### Precedence

The latest value updated in either platform will always take precedence. These fields can be changed even after an incident is resolved.

### View Custom Field Mappings

To view your Salesforce custom field mapping in PagerDuty, navigate to **Integrations**  →  **Extensions**  →  click **Edit** on the **Salesforce** extension tile  →  **Select Accounts**  →  **Custom Fields Mapping**.

### Edit Custom Field Mappings

At this time, you cannot edit Custom Field Mappings. Once created, you will need to delete and then recreate them.

### Delete Custom Field Mappings

> **Deletion Order:** You must delete the Custom Field mapping (using instructions below) before [deleting the Custom Field on the Custom Fields Page](/incident-management/incidents/custom-fields-on-incidents#delete-a-custom-field).

1. Navigate to **Integrations**  →  **Extensions**  →  click **Edit** on the **Salesforce** extension tile  →  **Select Accounts**  →  **Custom Fields Mapping**.
2. Select the **record** you want to delete.
3. Click **Delete**.
4. A confirmation modal will appear. Click **Delete** again to confirm.

## Salesforce Fields Eligible for Mapping

Fields of the following data types are eligible for mapping:

| Salesforce Field Type      | PagerDuty Field Type |
| :------------------------- | :------------------- |
| Text                       | Text                 |
| Pick List (Single)         | Single Select        |
| Pick List (Multi - Select) | Multiple Select      |
| URL                        | URL                  |
| Email                      | Text                 |
| Checkbox                   | Checkbox             |
| Date / Time                | Date Time            |
| Auto Number                | Integer              |
| Number                     | Decimal              |
| Percent                    | Decimal              |

> **Note:** Read-only and Lookup Salesforce fields cannot be mapped with PagerDuty custom fields.

## Post-mapping Behavior

### Post-mapping Behavior on the Custom Fields Mapping Page

The Custom Fields Mapping page in PagerDuty is located at **Integrations**  →  **Extensions**  →  click **Edit** on the **Salesforce** extension tile  →  **Select Accounts**  →  **Custom Fields Mapping**. 

The following behaviors are possible on this page:

- You **can** delete the mapping.
  - When this happens, future synchronization will stop. Any value on historical Integration records from this mapping will be preserved (i.e., no back-deleting values).
- You **can’t** delete the PagerDuty Custom Field created by the integration on the Custom Fields Mapping page. You must delete PagerDuty Custom Fields on the Custom Fields Page.
- You **can’t** edit the PagerDuty Custom Field Name or Description from the Custom Fields Mapping page; it is effectively a read-only mapping.

### Post-mapping Behavior on the Custom Fields Page

The Custom Fields page in PagerDuty is located at **Incidents**  →  **Custom Fields**. 

The following behaviors are possible on this page:

- You **can** edit the Custom Field Display Name and/or the Description.
- You **can** view the Custom Field in the PagerDuty UI.
- You **can’t** edit the Custom Field options (if it is a Single/Multi-select data type), but you can view the options.
- You **can’t** delete the Custom Field if it’s mapped to an integration. You must delete the Custom Field mapping  before deleting the Custom Field.

### Other Post-mapping Behavior

The integration will immediately update PagerDuty Custom Fields options when you make changes to the mapped Salesforce Record Field:

- If you add an option to a mapped Salesforce Record Field, the integration will add the option to the dropdown on the PagerDuty incident detail page.
- If you delete an option from a mapped Salesforce Record Field, the integration will delete the option from the dropdown on the PagerDuty incident detail page.
- If you rename an option in the Salesforce Record Field, the integration will reflect the new name in the dropdown on the PagerDuty incident detail page.

## Sync Custom Field Data Bidirectionally

In order for custom field data to sync bidirectionally, you must link the PagerDuty incident to a Salesforce record. Please see our [Salesforce Service Cloud User Guide](/integrations/salesforce-service-cloud-integration-guide/salesforce-service-cloud-user-guide#create-or-link-incidents) for more information.
