Write JSON
Write JSON
Section titled “Write JSON”Type: write-json · Package: JSON Activities v1.0.0 · Output: string
Converts a value (a dictionary, a list, an object) to JSON and saves it to a file. Useful for generating configuration files, exporting data or preparing the body of a request.
How it works
Section titled “How it works”Serializes value to JSON and writes it to path. By default it formats the result in a readable form (indented = true). Returns the written path.
Required parameters
Section titled “Required parameters”| Parameter | Editor | Description |
|---|---|---|
path | expression | Path of the output JSON file. |
value | expression | The value to convert (dictionary, list, object). |
Optional parameters
Section titled “Optional parameters”| Parameter | Editor | Description |
|---|---|---|
indented | boolean | Formatear de forma legible. Por defecto true. |
Output
Section titled “Output”Returns a string with the file path written.
Example
Section titled “Example”Create Dictionary outputVariable = resultadoSet Dictionary Value dict = = resultado key = "procesados" value = = totalSet Dictionary Value dict = = resultado key = "fecha" value = = today().ToString("yyyy-MM-dd")Write JSON path = "C:/salida/resumen.json" value = = resultadoRelated activities
Section titled “Related activities”- Read JSON — read a JSON.
- Create Dictionary — build the value to save.