# Working with NetSuite custom fields (services)

## Introduction

In Patchworks, [field mappings](/product-documentation/patchworks-services/working-with-services/field-mappings-and-transformations-services/field-mappings-services.md) are used to ensure that data pulled from fields in a source system, is mapped to the correct fields in a given destination system.&#x20;

When you [add or edit field mappings](/product-documentation/patchworks-services/working-with-services/field-mappings-and-transformations-services/field-mappings-services.md) for a service, Patchworks makes life simple by providing lists of standard fields for the associated source and destination systems. Additionally, non-standard, [custom fields can be mapped](/product-documentation/patchworks-services/working-with-services/field-mappings-and-transformations-services/field-mappings-services.md#mapping-custom-fields).&#x20;

NetSuite custom fields work in a very particular way, as summarised below.

## Pushing data to NetSuite custom fields&#x20;

The following information relates to the structure of custom field mappings for services where NetSuite is defined as the **destination**. If you're  adding/managing field mappings via the advanced editor (rather than via the dashboard field mapping UI), please keep these details in mind.

{% hint style="info" %}
If you are using the [dashboard UI](/product-documentation/patchworks-services/working-with-services/the-anatomy-of-a-service/service-mapping.md) to add/manage field mappings, this structure will be reflected as you navigate mappings for custom fields - information in this section may be useful background but you don't need to take any special action.&#x20;
{% endhint %}

Custom fields are organised into parts - for example:

* Customer
* Customer deposits

Each part includes a **customFieldList** and this must be referenced in the path specified for a mapping. The example below shows how we might map to a custom field named **cseg\_channel\_type**:&#x20;

<figure><img src="/files/oov9gmZpPcQA1h0eYyZ4" alt=""><figcaption></figcaption></figure>

Here:

**1** is the path to the custom fields part (**customerDeposits**)

**2** is the path from the custom fields part to the custom fields list (**customFieldList**)

**3** is the name of the custom field (**cseg\_channel\_type**)

## Pulling data from NetSuite custom fields&#x20;

The following information relates to the structure of custom field mappings for services where NetSuite is defined as the **source**. If you're  adding/managing field mappings via the advanced editor (rather than via the dashboard field mapping UI), please keep these details in mind.

{% hint style="info" %}
If you are using the [dashboard UI](/product-documentation/patchworks-services/working-with-services/the-anatomy-of-a-service/service-mapping.md) to add/manage field mappings, this structure will be reflected as you navigate mappings for custom fields - information in this section may be useful background but you don't need to take any special action.&#x20;
{% endhint %}

When pulling records with custom fields, they will be in the following format:

{% code lineNumbers="true" %}

```
Orders.0.customFields.custom_field_name_from_netsuite.name
```

{% endcode %}

### Dropdown fields

Some custom fields may be dropdown fields - for example:

<div align="left"><figure><img src="/files/EyzddxcbNozlNDRdtfTa" alt=""><figcaption></figcaption></figure></div>

In this case, the multiple fields would be mapped as:

{% code lineNumbers="true" %}

```
Orders.0.customFields.custom_field_name_from_netsuite.entityId
Orders.0.customFields.custom_field_name_from_netsuite.typeId
Orders.0.customFields.custom_field_name_from_netsuite.externalId
Orders.0.customFields.custom_field_name_from_netsuite.name
```

{% endcode %}

### Sub arrays

If custom fields are present in a sub array, the format would be the same from that point. In the example below, we show a custom field in the **itemList** sub array:

{% code lineNumbers="true" %}

```
Orders.0.itemList.item.o.customFields.custom_field_name_from_netsuite.name
```

{% endcode %}


---

# 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://doc.wearepatchworks.com/product-documentation/patchworks-services/service-systems/supported-service-systems/netsuite-service-connector/working-with-netsuite-custom-fields-services.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.
