Skip to content

Commit

Permalink
Merge pull request #7652 from AnalyticJeremy/patch-1
Browse files Browse the repository at this point in the history
Fixed example code for "json" function
  • Loading branch information
v-shils committed May 11, 2018
2 parents 41cf616 + feb6090 commit 55011b7
Showing 1 changed file with 1 addition and 1 deletion.
Expand Up @@ -212,7 +212,7 @@ In the following example, the pipeline takes **inputPath** and **outputPath** pa
|-------------------|-----------------|
|int|Convert the parameter to an integer. For example, the following expression returns 100 as a number, rather than a string: `int('100')`<br /><br /> **Parameter number**: 1<br /><br /> **Name**: Value<br /><br /> **Description**: Required. The value that is converted to an integer.|
|string|Convert the parameter to a string. For example, the following expression returns `'10'`: `string(10)` You can also convert an object to a string, for example if the **foo** parameter is an object with one property `bar : baz`, then the following would return `{"bar" : "baz"}` `string(pipeline().parameters.foo)`<br /><br /> **Parameter number**: 1<br /><br /> **Name**: Value<br /><br /> **Description**: Required. The value that is converted to a string.|
|json|Convert the parameter to a JSON type value. It is the opposite of string(). For example, the following expression returns `[1,2,3]` as an array, rather than a string:<br /><br /> `parse('[1,2,3]')`<br /><br /> Likewise, you can convert a string to an object. For example, `json('{"bar" : "baz"}')` returns:<br /><br /> `{ "bar" : "baz" }`<br /><br /> **Parameter number**: 1<br /><br /> **Name**: String<br /><br /> **Description**: Required. The string that is converted to a native type value.<br /><br /> The json function supports xml input as well. For example, the parameter value of:<br /><br /> `<?xml version="1.0"?> <root> <person id='1'> <name>Alan</name> <occupation>Engineer</occupation> </person> </root>`<br /><br /> is converted to the following json:<br /><br /> `{ "?xml": { "@version": "1.0" }, "root": { "person": [ { "@id": "1", "name": "Alan", "occupation": "Engineer" } ] } }`|
|json|Convert the parameter to a JSON type value. It is the opposite of string(). For example, the following expression returns `[1,2,3]` as an array, rather than a string:<br /><br /> `json('[1,2,3]')`<br /><br /> Likewise, you can convert a string to an object. For example, `json('{"bar" : "baz"}')` returns:<br /><br /> `{ "bar" : "baz" }`<br /><br /> **Parameter number**: 1<br /><br /> **Name**: String<br /><br /> **Description**: Required. The string that is converted to a native type value.<br /><br /> The json function supports xml input as well. For example, the parameter value of:<br /><br /> `<?xml version="1.0"?> <root> <person id='1'> <name>Alan</name> <occupation>Engineer</occupation> </person> </root>`<br /><br /> is converted to the following json:<br /><br /> `{ "?xml": { "@version": "1.0" }, "root": { "person": [ { "@id": "1", "name": "Alan", "occupation": "Engineer" } ] } }`|
|float|Convert the parameter argument to a floating-point number. For example, the following expression returns `10.333`: `float('10.333')`<br /><br /> **Parameter number**: 1<br /><br /> **Name**: Value<br /><br /> **Description**: Required. The value that is converted to a floating-point number.|
|bool|Convert the parameter to a Boolean. For example, the following expression returns `false`: `bool(0)`<br /><br /> **Parameter number**: 1<br /><br /> **Name**: Value<br /><br /> **Description**: Required. The value that is converted to a boolean.|
|coalesce|Returns the first non-null object in the arguments passed in. Note: an empty string is not null. For example, if parameters 1 and 2 are not defined, this returns `fallback`: `coalesce(pipeline().parameters.parameter1', pipeline().parameters.parameter2 ,'fallback')`<br /><br /> **Parameter number**: 1 ... *n*<br /><br /> **Name**: Object*n*<br /><br /> **Description**: Required. The objects to check for `null`.|
Expand Down

0 comments on commit 55011b7

Please sign in to comment.