JSON
Purpose: |
Create an empty object to store properties and values: [objectName('propertyName')] |
Category: |
JSON |
Syntax: |
CreateEmptyObject [object var] object var Variable to store the object properties and values. |
Example: |
CreateEmptyObject [MyObjectVar] SetVar [MyObjectVar('age')] 43 |
Purpose: |
Load a JSON file from a URL synchronously into a variable |
Category: |
JSON |
Syntax: |
LoadJSON "file URL" [result object var] URL to retrieve the JSON data from. result object var Variable to store the object properties and values from the JSON data. |
Example: |
LoadJSON "https://jsonplaceholder.typicode.com/todos/4" [myvar] SetVar [regtitle] [myvar('title')] SetVar [regid] [myvar('id')] AlertBox "JSON values:" "Title: [regtitle], Id: [regid]" "" |
Purpose: |
Load a JSON file from a URL asynchronously and sends the data to a subroutine once loaded |
Category: |
JSON |
Syntax: |
LoadJSON "file URL" "subroutine" URL to retrieve the JSON data from. subroutine Subroutine to execute once the data has been loaded. |
Example: |
LoadAsyncJSON "https://jsonplaceholder.typicode.com/todos/4" "mysubroutine" |
Purpose: |
Parse a string (written in JSON format) and return an object with properties and values: [objectName(property)] |
Category: |
JSON |
Syntax: |
ParseJSON "JSON string" [result object var] JSON string Data string in JSON format. result object var Variable to store the object properties and values from the JSON data. |
Example: |
ParseJSON "{ 'name':'John', 'age':30, 'city':'New York'}" [myvar] |
Purpose: |
Stringify an object with properties and values: [objectName(property)] to a string written in JSON format |
Category: |
JSON |
Syntax: |
StringifyJSON [source object var] [result var] Object variable to stringify with data in JSON format. result var Variable to store the result string. |
Example: |
StringifyJSON [myobjectvar] [myvar] |
Purpose: |
Parse CSV data into JSON format. |
Category: |
JSON |
Syntax: |
CsvToJSON [csv data] "delimiter character" [json object] [csv data] A variable with the CSV data. delimiter character Character that delimits data in CSV (usually "," or ";") [json object] Object variable to store the result |
Example: |
CsvToJSON [mycsv] ";" [myjson] |