KeyRoutines
StepFreetext.jsonPath

Pick one value out of JSON text or an API reply in a routine

Read JSON value finds one value inside JSON you already have, such as an API answer, copied text or a list or dictionary from an earlier step. Use it when you need one field out of a bigger answer. To read a JSON file on disk, use the Files pack's Read JSON value step.

How it works

  • Give it JSON text, or a list or dictionary from an earlier step.
  • Write the path as names and positions, like settings.volume or items[0].name; a leading $. is accepted too, and an empty path returns the whole value.
  • If the path leads nowhere, the step doesn't fail: it reports that the value isn't there, so you can branch on it.
  • Text that isn't valid JSON fails with a hint to check the quotes, commas and brackets.

Routines that use it

Temperature from a weather API

HTTP request fetches the forecast, Read JSON value takes current.temp, and Show banner displays it.

Copied JSON snippet

Get clipboard reads JSON you copied from a web tool, and Read JSON value pulls out the id for Type text to enter.

Script output

Run PowerShell prints a result, and Read JSON value picks the field the next step needs.

Settings

SettingWhat it does
JsonJSON text, or a list or dictionary from an earlier step.
PathWhich value, like settings.volume or items[0].name. Keep empty for the whole value.

Good to know

  • Paths use names and list positions only; filters and wildcards aren't supported.

Questions

How do I get one field from a JSON response?
Pass the response to Read JSON value and write the path to the field, such as data.items[0].id. The value comes out as the step's output for later steps.
What happens if the field doesn't exist?
The step still succeeds and reports that the value wasn't found. Use that result in an If to handle missing data.

Pairs well with

Build this routine in KeyRoutines

Free from the Microsoft Store for Windows 11 and 10. Pro is a one-time upgrade.