Skip to main content
Actions

Write custom field

How to set a custom field on a device or customer from an automation, which value format to use and when the step fails.

Use this action to set or clear a custom field, either on the run's device or on that device's customer. For example, you can store a result from an earlier step right on the device. The device doesn't need to be online.

Configuration fields

FieldTypeRequiredDefaultDescription
Custom fieldselectionYes—The field you want to write. The list groups the fields under Custom fields (Device) and Custom fields (Customer). A device field is written on the run's device, a customer field on that device's customer.
ValuetextNoemptyThe value you want to write. Supports variables ${{ … }}. Leave it empty to clear the field. octoja checks the value against the field's type only when the step runs.

You cannot save the automation without a selected field. octoja then shows A custom field is required for the write-custom-field step.

Enter the value in the format of the field's type:

Field typeValue format
Text, Multi-line text, Formatted text (Markdown)Any text up to 1,000, 10,000 or 20,000 characters. Leading and trailing spaces are removed.
IntegerA whole number, for example 42 or -7.
DecimalA number with a dot as decimal separator, for example 3.5.
Yes / Notrue or false.
DropdownExactly one of the defined options, spelled exactly as defined.
Multi-select dropdownOne defined option, or several as a JSON list such as ["Berlin","Hamburg"]. The previous selection is replaced completely.
DateA date as YYYY-MM-DD, for example 2026-12-31.

Platform support

The action runs inside octoja and works the same on every platform.

Outputs

OutputDescription
actionAction: set when the value changed, cleared when the field was emptied, unchanged when the field already had this value or was already empty.
valueValue: The written value as octoja stores it, for example a Yes / No value as true. Empty when the field was cleared.

Multi-select dropdown fields behave differently in two ways: action always reports set when you write a selection, even if nothing changed. And value does not contain the selected options — don't use this output in later steps for such a field.

Result behaviour

SituationResult
The value matches the field's type or is emptySucceeded. action shows whether anything changed.
The value does not match the field's type, for example text in an Integer field or an unknown optionFailed: The resolved value is not valid for the custom field. You'll find the reason in the step details. The field keeps its old value.
The selected field was deletedFailed: The selected custom field no longer exists.
A customer field is selected, but the device has no customerFailed: The device has no customer, or the customer was not found.

All devices of a customer share its customer fields. When the automation runs on several devices of the same customer, each run writes to the same field. The value of the last run is what remains.

If a variable resolves to an empty value, the field is cleared. If octoja cannot resolve a variable, it stays as literal text. A text field stores that text; all other field types reject it.

See also: Create an automation · Custom fields