ph_yamltojson PowerHome formula function
Description
Converts YAML data into an equivalent
JSON string
Syntax
ph_yamltojson ( as_yaml )
Argument | Description |
as_yaml | String. A string containing the YAML data you
wish to convert to JSON |
Return value
String. Returns a JSON string after
conversion from YAML. Returns "*ERROR* - " followed a description of the error
if
an exception occurs
Usage
Use this function to convert YAML data to
equivalent JSON data. This functions uses YamlDotNet and Newtonsoft.Json to
perform
the conversion
Examples
The following examples demonstrate typical syntax/usage for this function.
• ph_yamltojson(ph_readfile("c:\powerhome\phdata.yml"))
- Returns the YAML data in c:\powerhome\phdata.yml converted into an
equivalent JSON string. Returns "*ERROR* - " followed by an error description if
the data in the file is not properly formatted
YAML