For the complete documentation index, see llms.txt. This page is also available as Markdown.

Object

Object.compact()

Description: Removes all fields that have empty values, i.e. are null or ""

Syntax: Object.compact()

Returns: Object

Source: Custom n8n functionality

Examples:

// obj = {'x':null, 'y':2, 'z':''}
obj.compact() //=> {'y':2}

Object.hasField()

Description: Returns true if there is a field called name. Only checks top-level keys. Comparison is case-sensitive.

Syntax: Object.hasField(name)

Returns: Boolean

Source: Custom n8n functionality

Parameters:

  • name (String) - The name of the key to search for

Examples:

Object.isEmpty()

Description: Returns true if the Object has no keys (fields) set or is null

Syntax: Object.isEmpty()

Returns: Boolean

Source: Custom n8n functionality

Examples:

Object.isNotEmpty()

Description: Returns true if the Object has at least one key (field) set

Syntax: Object.isNotEmpty()

Returns: Boolean

Source: Custom n8n functionality

Examples:

Object.keepFieldsContaining()

Description: Removes any fields whose values don’t at least partly match the given value. Comparison is case-sensitive. Fields that aren’t strings will always be removed.

Syntax: Object.keepFieldsContaining(value)

Returns: Object

Source: Custom n8n functionality

Parameters:

  • value (String) - The text that a value must contain in order to be kept

Examples:

Object.keys()

Description: Returns an array with all the field names (keys) the object contains. The same as JavaScript’s Object.keys(obj).

Syntax: Object.keys()

Returns: Array

Source: Custom n8n functionality

Examples:

Object.merge()

Description: Merges the two Objects into a single one. If a key (field name) exists in both Objects, the value from the first (base) Object is used.

Syntax: Object.merge(otherObject)

Returns: Object

Source: Custom n8n functionality

Parameters:

  • otherObject (Object) - The Object to merge with the base Object.

Examples:

Object.removeField()

Description: Removes a field from the Object. The same as JavaScript’s delete.

Syntax: Object.removeField(key)

Returns: Object

Source: Custom n8n functionality

Parameters:

  • key (String) - The name of the field to remove

Examples:

Object.removeFieldsContaining()

Description: Removes keys (fields) whose values at least partly match the given value. Comparison is case-sensitive. Fields that aren’t strings are always kept.

Syntax: Object.removeFieldsContaining(value)

Returns: Object

Source: Custom n8n functionality

Parameters:

  • value (String) - The text that a value must contain in order to be removed

Examples:

Object.toJsonString()

Description: Converts the Object to a JSON string. Similar to JavaScript’s JSON.stringify().

Syntax: Object.toJsonString()

Returns: String

Source: Custom n8n functionality

Examples:

Object.urlEncode()

Description: Generates a URL parameter string from the Object’s keys and values. Only top-level keys are supported.

Syntax: Object.urlEncode()

Returns: String

Source: Custom n8n functionality

Examples:

Object.values()

Description: Returns an array with all the values of the fields the Object contains. The same as JavaScript’s Object.values(obj).

Syntax: Object.values()

Returns: Array

Source: Custom n8n functionality

Examples:

Last updated

Was this helpful?