Skip to content

Tips and tricks for JSON import preparation

MichaelJWhitney edited this page Aug 11, 2022 · 7 revisions

If you need to quickly prepare a JSON from a CSV or XLS file, the following instructions may help you.

1. Prep a CSV file with these headers:

eventCode
tenantId
eventDetails/businessObject/type
eventDetails/businessObject/globalIdentifiers/0/name
eventDetails/businessObject/globalIdentifiers/0/value
eventDetails/businessObject/<attribute1>
eventDetails/businessObject/<attribute2>
...
eventDetails/businessObject/<attributeN>

2. Fill in the first 5 columns as follows:

eventCode = "objectUpsertEvent"
tenantId = <<YOUR_TENANT_ID>>
eventDetails/businessObject/type = <<YOUR_OBJECT_TYPE>>
eventDetails/businessObject/globalIdentifiers/0/name = "sterlingSupplyChain.globalId"
eventDetails/businessObject/globalIdentifiers/0/value = <<an appropriate `globalIdentifier` for the data type>>

3. Add your attributes

Using the pattern eventDetails/businessObject/<attribute1>

4. Additional nested identifiers use a similar nomenclature as above

Resulting file will look something like this:

image

Select these options under Step 3: Choose output options (optional)

image

You probably also want to check this to suppress any empty values

image

6. Convert to json, save locally, and upload to COS