Data Types

The Data Types toolbox works with collections and conversions. It has lists, dictionaries, sets and pairs (tuples), the LINQ-style operations that filter, sort and group any collection, and nodes that turn one type into another, such as Text to Number.

Use it when one value is not enough: a list of file names, a lookup from a name to a price, or a set of IDs you have already seen.

  • Included in: Divooka Explore and Divooka Compute, every tier. Every document has it, even one made from the Blank workload.
  • Maturity: Stable · Support: Tier 1 (proposed) · what these mean
  • Open it: node library (Ctrl+Shift+Space) → Data Types, or search for a node with Ctrl+Space.
  • Examples and reference: Ctrl+Shift+E → Basics (12 examples) · node reference

New to graphs? Start with Your first program.

Main ideas

List, set, dictionary. A list keeps items in order and allows repeats. A set keeps each value once. A dictionary maps a key to a value.

Choose the item type. Collection nodes are generic: a property on the node, T, says what the collection holds, such as text or numbers. Set it in the Properties panel.

Unlike tables and grids, lists and sets change in place. Add and Sort change the list you give them. Union is the exception: it returns a new set and leaves both inputs as they were.

Example: a list and a set side by side

The task: see the difference between a list and a set.

Open Basics > Collections from the examples (Ctrl+Shift+E). It is a Routine graph in four parts, each starting with a Print Line heading:

  1. A list keeps order. Create (List Routines) makes an empty list of text. Three Add nodes add Cherry, Apple and Banana. Sort sorts it. Get with Index 0 reads the first item, Count counts the items, and Contains checks for Apple.
  2. A set keeps each value once. Create (Set Routines) makes an empty set. Add Apple twice, then Durian, printing what each Add returns. Count counts the set.
  3. Union returns a new set. Create makes a second set from the list, Union joins the two sets, Count counts the result and Contains checks it for Banana.
  4. A pair travels as one value. Create (Value Tuple Routines) makes a pair of Banana and 0.75, and two Get nodes read it back.

Run it with F5. The console shows:

A list keeps order:
Apple
3
True
A set keeps each value once:
True
False
True
2
Union answers a new set:
4
True
A pair travels as one value:
Banana
0.75

The second Add of Apple returns False: the set already had it.

To use your own data: wire any array into Create (Set Routines) or To List to start from values you already have.

More examples to open

Example What it shows
Basics > Dictionary Basics Add, read and update a dictionary
Basics > Array Coercion Several wires into one array input
Basics > Function Delegates Functions used by Select and Where

Tips and limits

  • Text to Number reads one spelling. It accepts a dot for the decimal point and no grouping, such as 1.5 or -2.25e3. Text such as 1,5 is refused, not misread. Use a Try step from Basic where the text might not be a number.
  • Quick Store keeps values by name. Set Session Storage and Get Session Storage keep a value for as long as the program that holds it is running. Set Permanent Storage and Get Permanent Storage write it to a database file, so it lasts between runs.
  • For tables, use Data Analytics. A list of records is fine for a few hundred items. For rows and columns you want to filter, group and save, use Data Analytics.

Goes well with: Basic for loops over collections.

What is in the toolbox

Category Some of its nodes
Enumerable Routines All, Any, Append, As Enumerable and 56 more
List Routines Add, Add Range, As Read Only, Binary Search and 38 more
Conversion Routines Boolean to Text, Number Byte to Text, Character to Text, Convert Value Type and 37 more
Dictionary Routines Add, Add Or Reject Duplicate, Add Range, Capacity and 18 more
Value Tuple Routines Compare, Compare Objects, Create, Equals and 12 more
Set Routines Add, Clear, Clone, Comparer and 15 more
Quick Store Configure Storage, Get Named Storage, Get Permanent Storage, Get Session Storage and 3 more
Object Routines Create, Equals, Get Hash Code, Get Type and 4 more
Dynamic Operations Get Properties, Get Property Value, Make Expando, Make Object and 1 more
Collections Helper Extract, Filter

See also