Read JSON
Read JSON
Section titled “Read JSON”Type: read-json · Package: JSON Activities v1.0.0 · Output: object
Reads a JSON file and returns its contents already structured: a dictionary (object) or a list (array), navigable by its keys and indexes. You don’t need to parse text: the result is ready to use.
How it works
Section titled “How it works”It reads the path file, interprets its JSON, and returns the structure. Then you access the data with expressions: dato["clave"], list[0], etc.
Required parameters
Section titled “Required parameters”| Parameter | Editor | Description |
|---|---|---|
path | expression | JSON file path. |
Optional parameters
Section titled “Optional parameters”Ninguno.
Output
Section titled “Output”Returns a object: a dictionary or a list, depending on the JSON.
Example
Section titled “Example”Read JSON path = = asset("config.json") → output: configSet Variable name = timeout value = = config["timeout"]Log message = = "Primer item: " + str(config["items"][0]["nombre"])Related activities
Section titled “Related activities”- Write JSON — save a value as JSON.
- HTTP GET — receive JSON from an API.