Skip to main content

Add to Set

Add an item to a set

Written by Holly Conrad Smith

Use this to build up a set one item at a time — for example, stepping through a project's features in a loop and collecting every unique usage type you encounter along the way.

Set vs. List: a List (array) keeps items in order and can hold duplicates — you access items by position, like "the 3rd item." A Set has no order and no duplicates — adding an item that's already there does nothing, and there's no "position" to ask for. Sets are for asking "is this here?" and for comparing groups of things; Lists are for ordered, step-by-step sequences.

Category: Sets

Kind: Operation

Description: add an item to a set

Inputs

Name

Abbreviation

Type

Access

Description

set

S

Set

Item

the set to add to

item

I

Any

Item

the item to add

Outputs

Name

Abbreviation

Type

Access

Description

set

S

Set

Item

the updated set

How to

  1. Add the Add to Set node.

  2. Feed in an existing set (or an empty one from the Set node) and the item to add.

  3. The output is the updated set — if the item was already in the set, nothing changes.

Did this answer your question?