contentitem
The contentitem
object holds the Print Content Item that will be written to the Connect database when generating Print output.
Its properties
field allows to add custom properties to the Print Content Item, in the form of key-value pairs (a JSON string).
Custom properties can be utilized for further processing in a Workflow configuration with the Retrieve Items task. The Retrieve Items task retrieves custom properties along with the base record information (see Retrieve Items in Workflow's Online Help).
The contentitem
object can be used in any type of script. However, if you want to add production information - such as the page, size, and position of elements after pagination - to the properties
, you have to write a Post Pagination Script (see Post Pagination Scripts).
Field | Type | Description |
---|---|---|
properties | Properties |
Key-value pairs containing custom properties. |
Example
This following code would add a property called 'myProperty' with the value 'myvalue':
contentitem.properties.myProperty = 'myvalue';
You can replace 'myProperty' and 'myvalue' with whatever name and value best suits the use case.
If the name of the property contains a space you'll need to put it between brackets and quotation marks:
contentitem.properties['name with spaces'] = 'value';
If the value is a number you don't need to put it between quotation marks:
contentitem.properties.custom_property = 123;