SugarAI Import Records XML
This XML format represents records in SugarAI, along with their fields and the values of those fields.
Tasks
Minimal XML Sample
<?xml version="1.0" encoding="utf-8"?>
<Records Module="Opportunities">
<Record>
<Id>95e6d851-9723-4bd1-85f7-464b933faea6</Id>
<Field Name="name">Test Opportunity</Field>
</Record>
</Records>
In each of the following sections most of the XML has been omitted to make the samples easier to read. The whole structure of the Records schema is used below as a reference of where fields should be in the object model.
Records
The Records element represents a collection of records to be uploaded to SugarAI. This element appears at the root of the XML document.
| XML Field | Example | Field Type | Input | Description |
|---|---|---|---|---|
| @Module | Opportunities | string | Required | The name of the module the records in the collection belong to. You can browse module names via the 'Module' setting on the Export Records task. |
| Record | See below | Record | Optional | A list of 0 or more Record elements. |
<?xml version="1.0" encoding="utf-8"?>
<Records Module="Opportunities">
<Record>
<!-- See below -->
</Record>
</Records>
Record
The Record element represents an individual record to be uploaded to SugarAI. This element appears as a child of the Records collection.
| XML Field | Example | Field Type | Input | Description |
|---|---|---|---|---|
| Id | 95e6d851-9723-4bd1-85f7-464b933faea6 | GUID | Optional | You can specify the ID of an existing record to update here. |
| Key | name | string | Optional | Used to specify the name of a field to use to look up the ID of an existing record. |
| Operation | Upsert | enum | Optional | The type of operation to perform. Valid values: Insert, Update, Upsert. Defaults to Upsert. |
| Field | See below | Field | Required | One or more Field elements, indicating the values to set different fields to. |
| LinkField | See below | LinkField | Optional | Zero or more LinkField elements, indicating other related objects to link to this record. |
<Records Module="Opportunities">
<Record>
<Id>95e6d851-9723-4bd1-85f7-464b933faea6</Id>
<Key>name</Key>
<Operation>Upsert</Operation>
<Field Name="name">
<!-- See below -->
</Field>
<LinkField Name="accounts">
<!-- See below -->
</LinkField>
</Record>
</Records>
Field
The Field element represents an individual field and the value you want to set it to. 1 or more instances of this element can be specified within the Record element.
| XML Field | Example | Field Type | Input | Description |
|---|---|---|---|---|
| @Name | name | string | Required | The name of the field (case sensitive). You can browse field names via the 'Fields' setting on the Export Records task. |
| . | Test Opportunity | string | Optional | The value to set the field to. More info on the different types of field can be found below. If not specified, the existing value of the field will be cleared. |
<?xml version="1.0" encoding="utf-8"?>
<Records Module="Opportunities">
<Record>
<Field Name="name">Test Opportunity</Field>
</Record>
</Records>
How to Set the Value for Different Field Types
We recommend populating the value as follows for different field types in SugarAI. Other field types not listed here are all treat as strings.
If you want to populate a field of type link, please use the dedicated LinkField element instead.
| Sugar Type | Zynk Value | Example |
|---|---|---|
| bool | Specify either true or false. |
true |
| currency | Specify a decimal value. | 10.25 |
| date | Specify a date in ISO 8601 format. | 2026-01-31 |
| dateTime | Specify a date and time in ISO 8601 format. | 2026-01-31T09:59:59Z |
| decimal | Specify a decimal va. | 10.25 |
| id | Specify a valid GUID. | 95e6d851-9723-4bd1-85f7-464b933faea6 |
| int | Specify an integer value. | 123 |
LinkField
The LinkField element represents a relationship to another record in SugarAI. 0 or more instances of this element can be specified within the parent Record element.
The LinkField element contains a collection of child Record elements, which support all functionality of the parent Record elements. So you can either provide the ID of the object, or use a key to look it up. You can also specify further related records, in a recursive pattern.
| XML Field | Example | Field Type | Input | Description |
|---|---|---|---|---|
| @Name | accounts | string | Required | The name of the field (case sensitive). You can browse field names via the 'Fields' setting on the Export Records task. |
| @Module | Accounts | string | Required | The name of the module the related record belongs to. You can browse module names via the 'Module' setting on the Export Records task. |
| @IdField | account_id | string | Dependant | When dealing with a one to one relationship, it is sometimes necessary to specify the name of the field which stores the ID on the parent record. |
| Record | See above | Record | Required | One or more Record elements, representing the records to be linked. |
<?xml version="1.0" encoding="utf-8"?>
<Records Module="Opportunities">
<Record>
<LinkField Name="accounts" Module="Accounts" IdField="account_id">
<Record>
<!-- See above -->
</Record>
</LinkField>
</Record>
</Records>
Complete XML Sample
This sample shows all data that can be provided via our SugarAI Import Record XML format.
<?xml version="1.0" encoding="utf-8"?>
<Records Module="Opportunities">
<Record>
<Id>95e6d851-9723-4bd1-85f7-464b933faea6</Id>
<Key>name</Key>
<Operation>Upsert</Operation>
<Field Name="name">Test Opportunity</Field>
<Field Name="description">Just a test</Field>
<LinkField Name="accounts" Module="Accounts" IdField="account_id">
<Record>
<Key>name</Key>
<Field Name="name">Test Account</Field>
</Record>
</LinkField>
<LinkField Name="revenuelineitems" Module="RevenueLineItems">
<Record>
<Key>name</Key>
<Field Name="name">T-Shirt</Field>
<Field Name="sales_stage">Prospecting</Field>
<Field Name="date_closed">2026-06-30</Field>
<Field Name="forecasted_likely">10.00</Field>
<Field Name="quantity">1</Field>
</Record>
</LinkField>
</Record>
</Records>