jsonCreateObjectFromDataFile (JSON Creation & Manipulation)
Compatible with:
- Purpose
- This command is used to create a JSON Object from the contents of a data file.
- If the mentioned data file is not available, run fails with error "Datafile name provided in the 'Target' field does NOT exist in the scope of the project".
- In Worksoft SaaS, a data file is always associated with a data definition. Attributes/Fields in the data definition are converted to "Key" in the JSON document while the contents of the data file make up for "Value" in the JSON document.
- You can also optionally pass the Data Filter name along with Data file name to create a JSON object.If you do not have filters just pass the Data File name with status.
- Syntax
- jsonCreateObjectFromDataFile({dataFileName(status)||dataFilterName(optional)},VariableName)
- Target
- dataFileName(status)||dataFilterName(optional)
- You can optionally pass the Filter Name of the Data File separated by pipe symbol ("||").
- Value
- VariableName
- Return Value
- JSON Object.
Example(s):
Click here to see the example