Help Centre › Functions & Formulas
This article describes the RPA Data Format functionality to set a value in JSON data.
For a full list of available functions, please read DATA FORMAT functions.
Description
The Set JSON function sets a value at a specified path in JSON data. If intermediate keys do not exist, they are created automatically.
Setting it up
To use the Set JSON function, follow these instructions:
{{popups:rpas/add:action=json-set}}
Once on a process map:
- Navigate to the process where you would like to add the Set JSON function
- Click on the green button’s drop-down (right side of the green button labelled “Process”)
- On the menu that appears, click on the “+ Activity” item
- From here you can select the DATA FORMAT Set JSON option
- Click "Add" once you are done
Input parameters
| Parameter | Required | Type | Default | Description |
|---|---|---|---|---|
| Data | Yes | Text | - | The JSON data to modify (string or variable) |
| Path | Yes | Text | - | Dot-notation path where the value should be set |
| Value | Yes | Text | - | The value to set at the specified path |
| Variable | No | Text | data | Variable name to store the modified JSON |
Output variables
| Variable | Type | Description |
|---|---|---|
| {data} | Any | The modified JSON data with the value set |
Errors
| Error | Description |
|---|---|
| Invalid JSON | The data is not valid JSON |
| Invalid path | The specified path is not valid |
Tips
- Intermediate keys are created automatically if they do not exist
- Use this to build JSON payloads dynamically for API calls