Roboteka
Roboteka · Robots · Build JSON from fields

Build JSON from fields

The Build JSON from fields robot assembles a JSON object from two Multiple lists: keys and the corresponding values in the same order. Numeric strings are cast to numbers, true/false to booleans, and empty keys are skipped. It returns a ready JSON string, optionally pretty-printed, for sending to a webhook or external API from a Bitrix24 (Alaio) business process.

The robot builds a JSON string right inside a Bitrix24 (Alaio) business process or robot, with no code required. It takes two Multiple fields as input: keys and values ordered in parallel (the first value belongs to the first key, and so on). Values are auto-cast by type: numeric strings become integers or floats, the strings true and false become booleans, and everything else stays a string; empty keys are skipped. Unicode and slashes are left unescaped, and the pretty-print flag (Y/N) enables readable, indented output. Use it when you need to assemble a request body for an external API or incoming webhook, pass structured data to another step of the process, or store a set of fields in a single text field. It returns the resulting JSON string for use in later steps.

What input parameters does the robot accept?

Parameter Type Required? Default
Keys (Multiple) string yes
Values (Multiple, order must match keys) string yes
Pretty-print with indentation (Y/N, default N) string

What does the robot return?

Parameter Type
Resulting JSON string

Scenario: sending deal data to an external service

  1. A deal enters the Paid stage
  2. The robot builds JSON from keys id, amount, paid and the deal values
  3. The ready JSON string is passed to the HTTP request robot to post to a webhook

Related robots

Related articles