Skip to main content

DeduplicateValuesbyKey

This Script is part of the Common Scripts Pack.#

Supported versions

Supported Cortex XSOAR versions: 6.0.0 and later.

Given a list of objects and a key found in each of those objects, return a unique list of values associated with that key. Returns error if the objects provided do not contain the key of interest.

Script Data#


NameDescription
Script Typepython3
Tags

Inputs#


Argument NameDescription
object_listList of objects (dictionaries).
key_of_interestString representing key from which unique values should be retrieved. Use dot notation to access subkeys (e.g. 'key.subkey')
keep_noneDefault is False. If set to True, will return None in the unique list if the key is not found

Outputs#


PathDescriptionType
DeduplicatedValuesList of unique values for the specified keyUnknown