utilities/resolve

Utility to transform an object recursively for searches subqueries, templating, email creation, file loading/creation, array merging/sorting/ordering, object flattening.

Parameters

Parameter

Type

Attributes

Description

data

*

Required

Data to recurse and transform

data.template

String

Optional

Freemarker template to render with the data found on all sibling properties. Use the property name to access the data in the template. The rendered string is returned.

data.boolean

Boolean

Optional

Returns true if all sibling properties are truthy. Array values must all be truthy to pass. Setting to false passes when all values are falsey.

data.parse

String

Optional

JSON string to parse and return.

data.array

Boolean, String

Optional

Concatenates and all property arrays as a single array. If array is a string, the concatenated array is sorted by that property.

data.sort

String

Optional

Sort the concatenated array by this property before returning.

data.join

Boolean, String

Optional

Join the concatenated array before returning as a string. If join is a string, that value is used as the seperator.

data.file

String, Number

Optional

Loads and returns a file when this is a path string or internalid number. If file is a file extension, a file is created from the content property and is returned.

data.contents

String

Optional

Content of the file to create. If the file option is 'pdf', the content is converted from xml to pdf before creating.

data.name

String

Optional

Name of the file to create. If no name is defined, name is set to the title xml tag found in the content property.

data.record

String

Optional

Returns either a record search or loaded record of this record type.

data.id

Number

Optional

Loads and the record with this internalid.

data.filters

*

Optional

Searches the record using these filters.

data.map

*

Optional

Searches the record using this field map.

data.form

*

Optional

Extends the map property with all fields found on a form.

data.body

String

Optional

When body and recipients properties are present, consider this an email definition.

data.recipients

Array.<String>

Optional

When body and recipients properties are present, consider this an email definition.

data.subject

String

Optional

When no email subject is defined, subject is set to the title tag found in the body property.

data.options

Array.<Object>

Optional

The option in the array with the lowest value for the selected property has selected set to true. All other options have selected removed.

Returns

Type

Description

*

Transformed object

General Notices