Setting workflow data field value
Dynamic Content can be used to automatically change value of data field in workflow for currently processed subscriber, using SetWorkflowDataField method.
Note that this method can be used only inside workflows (workflow messages, api call element, execute code element).
Method signature:
SetWorkflowDataField(name, value)
name parameter is name of data field.
value parameter is new value of data field which will be set for subscriber.
Method always returns empty string.
value parameter will accept any object, but it is important to set appropriate value, depending on data field type. See examples below for different types of data fields.
Boolean properties:
${SetWorkflowDataField('some_boolean', true)}
${SetWorkflowDataField('some_boolean', false)}
Text properties:
${SetWorkflowDataField('some_text', 'foobar')}
Number properties:
${SetWorkflowDataField('some_number', 123)}
Date and DateTime properties:
${SetWorkflowDataField('some_date', '2013-12-02')}
${SetWorkflowDataField('some_datetime', '2013-12-02 10:15:00')}
${SetWorkflowDataField('some_date', new System.DateTime(2013, 12, 2).Date)}
${SetWorkflowDataField('some_datetime', new System.DateTime(2013, 12, 2, 10, 15, 0))}
NOTE: For convenience, it is possible to provide date/datetime as a string, but it is required to use sortable (ISO) format: YYYY-MM-DD hh:mm:ss.
All dates are treated as dates in business unit’s timezone.