ph_jsontoyaml PowerHome formula function
Description
Converts JSON data
to YAML
Syntax
ph_jsontoyaml ( as_json )
Argument | Description |
as_json | String. A string containing properly formatted JSON data |
Return value
String. Returns the supplied JSON data
converted
to YAML data
Usage
Use this function to convert JSON data
to YAML (YAML Ain't Markup Language)...a text based markup language with
heirarchy represented by indentation (see
http://yaml.org). The conversion is done using a C#
YamlDotNet object
Examples
The following examples demonstrate typical syntax/usage for this function.
• ph_jsontoyaml('{"people":[{"name":"John","age":31,"city":"New
York","phones":["4075551212","3215551212","8885551212"]}]}')') - Returns the
following YAML string: "people:~r~n- name: John~r~n age: 31~r~n city: New York~r~n phones:~r~n - 4075551212~r~n - 3215551212~r~n - 8885551212~r~n"