Importing Records into SugarAI
This task will insert new records and update existing records in SugarAI. An update is performed if the record ID was provided in the input file, or an existing record is found in SugarAI where the value of the key field matches the value specified in the input file. If no matching record is found, a new record will be created in SugarAI.
The task supports setting relationships between records in SugarAI, using link fields. The related records themselves can also be created and updated by this task.
Settings
Connection
Required
The SugarAI connection details to use. See Connecting to SugarAI.
Fail File
Required
The file to save failed records to.
Input File
Required
The file containing records you would like to import.
Success File
Required
The file to save successful records to.
Zynk Settings
Examples
The sample input file shown below will look for a product in SugarAI with manufacturer part number "TSHIRT01", and create it if it does not exist, or update it if it does. It will link the product to a manufacturer by the name "Zynk Software", automatically creating the manufacturer if it does not already exist, or updating it if it does.
For full documentation about the XML format, see SugarAI Import Records XML.
<Records Module="ProductTemplates">
<Record>
<Key>mft_part_num</Key>
<Operation>Upsert</Operation>
<Field Name="name">Cotton T-Shirt</Field>
<Field Name="mft_part_num">TSHIRT01</Field>
<Field Name="discount_price">10</Field>
<Field Name="list_price">10</Field>
<Field Name="date_available">2026-06-18</Field>
<Field Name="tax_class">Taxable</Field>
<Field Name="weight">1.5</Field>
<LinkField Name="manufacturer_link" Module="Manufacturers">
<Record>
<Key>name</Key>
<Operation>Upsert</Operation>
<Field Name="name">Zynk Software</Field>
</Record>
</LinkField>
</Record>
</Records>
A sample success file is shown below, containing the ID of the newly created product.
<?xml version="1.0" encoding="utf-8"?>
<Records xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
<Record>
<Id>08e2b0a8-6b17-11f1-ab6a-0242a8b23525</Id>
<Key>mft_part_num</Key>
<Operation>Upsert</Operation>
<Field Name="name">Cotton T-Shirt</Field>
<Field Name="mft_part_num">TSHIRT01</Field>
<Field Name="discount_price">10</Field>
<Field Name="list_price">10</Field>
<Field Name="date_available">2026-06-18</Field>
<Field Name="tax_class">Taxable</Field>
<Field Name="weight">1.5</Field>
<Field Name="manufacturer_id">49fa4336-6e27-11f1-b5ad-0242a8b23525</Field>
<LinkField Name="manufacturer_link" Module="Manufacturers" IdField="manufacturer_id">
<Record>
<Id>49fa4336-6e27-11f1-b5ad-0242a8b23525</Id>
<Key>name</Key>
<Operation>Upsert</Operation>
<Field Name="name">Zynk Software</Field>
</Record>
</LinkField>
</Record>
</Records>