KeyRoutines
StepFreefile.readJson

Read a value from a JSON file in a Windows routine

Read JSON value opens a JSON file and picks out a single value by its path, or the whole document if you leave the path empty. It lets a routine use settings you keep in a small config file.

How it works

  • Choose the JSON file and the path to the value, written like settings.volume or profiles[0].name.
  • Leave the path empty to get the whole file.
  • It outputs the value and whether it was found, so an If can handle a missing entry.
  • It only reads, so dry runs behave exactly like real ones.

Routines that use it

Volume from a config file

Read a volume level from your settings file and pass it to Set volume, so changing the file changes the routine.

Pick a profile

Read the first profile's name from a JSON list and use Switch to run a different set of steps for each one.

Count up between runs

Read a counter, raise it with Calculate, and save it back with Write JSON value.

Settings

SettingWhat it does
PathThe JSON file.
Value pathWhich value, like settings.volume or profiles[0].name. Keep empty for the whole file.

Good to know

  • A cloud "online only" file is not read; it needs to be on the PC first.

Questions

How do I read one setting from a JSON file?
Add Read JSON value, pick the file and type the value's path, such as audio.volume. The value comes out as the step's output for later steps.
What if the value isn't in the file?
The step tells you it wasn't found through its found output, so you can branch with If instead of using an empty value.

Pairs well with

Build this routine in KeyRoutines

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