Command json.getelement

The command json.getelement is used to read the contents of a JSON file by passing the desired field as a parameter.

Parameters

  1. filename [string]
    Name of the JSON file you want to read.
  2. jsonstring [string]
    Json element to search.
  3. jsonvalue [string]
    Variable that will store the value of the returned element.
  4. variablereturn [integer]
    Variable that will store the return of the command.

Example


In the example above, the function fn_json_new_string is responsible for storing JSON content in memory.

The function fn_json_save_message opens the JSON file and write all data. If the file does not exist, it will be created automatically.

After finishing the process, the function fn_json_print_str will read the selected fields and print them on the pattern you want.