Skip to main content
Version: Streamsheets 3.0

WRITE

Adds the key and value to a JSON object in the outbox. The path to the key will be created as needed.

Syntax

=WRITE(Key, Value, [Type], [TTL])

Arguments

NameTypeDescription
KeyStringA key to a data item, that should be written. The key is usually created by using the OUTBOXMETADATA or OUTBOXDATA utility functions. The key consists of the path to the item within the JSON object.
ValueValueValue to assign to key.
Type (optional)ValueTypeType of Value.

Options:
"String"
"Number"
"Boolean"
"Array"
"Dictionary"
"Json"
"JsonRoot"
TTL (optional)NumberThe "time to live" period in seconds. If the specified period expires the corresponding message will be removed from the outbox. Default is indefinitely.

Return

TypeDescription
StringThe last part of the key of the data value to write.

Examples

FormulaResultComment
=WRITE(OUTBOXDATA("Message", "Customer", "Name"), "Maier", "String")
Outbox
Example to write a value to a JSON object in the outbox.
=WRITE(OUTBOXDATA("Message", "Units"),READ(INBOXDATA(,,"Units")))/>

You can also direct data from the Inbox into the Outbox. In this example the “Units” array from the Inbox is automatically transferred to the Outbox.
=WRITE(OUTBOXDATA("Message", "Output",-1),JSON(J22:K24),)
Outbox
Pro tip: If you want to automatically create an array, use -1 as the last OUTBOXDATA() parameter. This way the array will increment starting from 0.