create-dictionary-from-datatable

Description

create-dictionary-from-datatable adaptor creates a new dictionary from two columns in a datatable.

Inputs

data Type: datatable Required: Yes The datatable containing key-value pairs.

key column Type: text Required: Yes The name of the column which contains keys. If unspecified, defaults to key.

value column Type: text Required: Yes The name of the column which contains values. If unspecified, defaults to value.

Outputs

dictionary Type: dictionary A dictionary containing key-value pairs.

Examples

Example 1: Default behaviour.

Inputs:

data:

id
code
name

1

GB

United Kingdom

2

TR

Turkey

3

US

United States

key column: code

value column: name

Outputs:

dictionary:

Code
Name

GB

United Kingdom

TR

Turkey

US

United States

-> Created dictionary from datatable with the key column code and value column name.

Use Cases

  • Creating bins for data, based on known relationships or categories.

  • Creating a dynamic dictionary in a spreadsheet that multiple people can edit and update, and feeding that spreadsheet into Data-flo as a map, enabling the automatic remapping of frequently-misspelt words.

  • Using a spreadsheet to update sample lists and their positions in laboratory experiment plates.

Last updated