I’m using PlanetPress Connect Designer (v1.4.2) to process an XML file into a datamap. There are some sections where the data value (all strings) may be blank and, in those cases, I’d like to use a default in place of the blank.
Can I use the Postprocessor to do this? If so, could someone help me with a sample script to test for empty values and replacing them with a default value. If not, how can I achieve this?
you could add an additional data field to your data model and assign the XML field or a default value depending on the content of the original XML data; this could be done with JavaScript in an Action step.
where ‘field0’ is assumed to be the original record field you need to check and ‘field1’ is the additional field added to the data model (don’t forget to give it a default value when adding to make it usable).
The code is assigning a default string (‘default content’ in the sample above) to the custom field if the original field is empty, otherwise it’s assigning the content of the original field.