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 this format, with each sObject tag representing a record.
Each batch in a JSON file uses this format with each JSON object representing a record.
You must include the type field for a polymorphic field and exclude it for non-polymorphic fields in any batch. If you don’t the batch fails. A polymorphic field can refer to more than one type of object as a parent. For example, either a contact or a lead can be the parent of a task. In other words, the WhoId field of a task can contain the ID of either a contact or a lead.
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
nullin XML, set thexsi:nilvalue for the field totrue. For example,<description xsi:nil="true"/>sets the description field tonull. Settingxsi:niltofalsehas no effect. If you define a field value and setxsi:niltofalse, the value still gets assigned. To specify a null value in JSON, set the field value tonull. For example,"description" : null. - Fields with a
doubledata 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 theW3C XML Schema Part 2: Datatypes Second Edition specification
See Also