Newer Version Available
Valid XML and JSON Records
A batch request in an XML or JSON file contains records for one object type. Each
batch in an XML file uses the following format with each sObject tag representing a record.
1<?xml version="1.0" encoding="UTF-8"?>
2<sObjects xmlns="http://www.force.com/2009/06/asyncapi/dataload">
3 <sObject>
4 <field_name>field_value</field_name>
5 ...
6 </sObject>
7 <sObject>
8 <field_name>field_value</field_name>
9 ...
10 </sObject>
11</sObjects>Each batch in a JSON file uses the following format with each JSON object representing a record.
1[
2 {
3 "field_name" : "field_value"
4 ...
5 }
6 {
7 "field_name" : "field_value"
8 ...
9 }
10]When generating records in XML or JSON files:
- Fields that aren’t defined in the file for a record are ignored when you update records. To set a field value to null in XML, set the xsi:nil value for the field to true. For example, <description xsi:nil="true"/> sets the description field to null. Setting xsi:nil to false has no effect. If you define a field value and set xsi:nil to false, the value still gets assigned. To specify a null value in JSON, set the field value to null. For example, "description" : null.
- Fields with a double data type can include fractional values. Values can be stored in scientific notation if the number is large enough (or, for negative numbers, small enough), as indicated by the W3C XML Schema Part 2: Datatypes Second Edition specification.