Workflow REST API: Item References
You can use JSON, XML or a combination to post Item Reference data to a Workflow Instance or Tasks.
Posting data to Item References using XML
Note the escape character \ for each quotation mark in the "xmlContent" section.
"itemReferences": {
"xmlContent": "<itemReferences> <itemReference name=\"Leave_Request_SmartObject\" displayName=\"Leave Request SmartObject\" type=\"SmartObjectItem\" primary=\"true\" startMode=\"smartForms\"> <settings><method><objectName>Leave_Request_SmartObject</objectName><methodName>Load</methodName> <methodType>Read</methodType><objectTypes><type>Default</type></objectTypes> </method></settings><definition></definition><items lastId=\"1\"><item id=\"1\"> <properties><property name=\"ID\">1</property></properties> <parameters /></item></items></itemReference></itemReferences>"
}
}
Posting data to Item References using JSON notation
If you need to pass in or read item references in JSON format, this sample illustrates the expected format. For example, a SmartObject with a System Name of foo, record ID 1, with a field named bar that accepted string values:
"foo": {
"1": {
"bar": "bar's value."
}
}
}
Here is another example, showing a hypothetical SmartObject named Customer with a record ID of 1, and two properties: CustomerCode with value "AZ200" and Region with value 12.
"Customer": { //"Customer" is the system name/identifier of the SmartObject definition
"1": { //"1" is the record ID of the specific record to edit
"CustomerCode": "AZ200", //"CustomerCode is one of the SmartObject fields, "AZ200" is the value
"Region": 12, //"Region" is another SmartObject field, 12 is the value
}
},