Skip to content
Permalink
Browse files

Fix expression "if" documentation

  • Loading branch information
m-kuhn committed Mar 31, 2016
1 parent b3edfa8 commit ec17e3cc8efea1f35a11a863a80b7cef85e06576
Showing with 11 additions and 10 deletions.
  1. +11 −10 resources/function_help/json/if
@@ -3,16 +3,17 @@
"type": "function",
"description": "Tests a condition and returns a different result depending on the conditional check.",
"arguments": [
{"arg":"condition","description":"the condition which should be checked"},
{"arg":"result_when_true","description":"the result which will be returned when the condition is true or another value that does not convert to false."},
{"arg":"result_when_false","description":"the result which will be returned when the condition is false or another value that converts to false like 0 or ''. NULL will also be converted to false."}
{"arg":"condition","description":"the condition which should be checked"},
{"arg":"result_when_true","description":"the result which will be returned when the condition is true or another value that does not convert to false."},
{"arg":"result_when_false","description":"the result which will be returned when the condition is false or another value that converts to false like 0 or ''. NULL will also be converted to false."}
],
"examples": [ { "expression":"if( 1+1=2, 'Yes', 'No' )", "returns":"'Yes'"},
{ "expression":"if( 1+1=3, 'Yes', 'No' )", "returns":"'No'"}
{ "expression":"if( 5 > 3, 'One', 'Not One' )", "returns":"'One'"}
{ "expression":"if( '', 'It is true (not empty)', 'It is false (empty)' )", "returns":"'It is false (empty)'"}
{ "expression":"if( ' ', 'It is true (not empty)', 'It is false (empty)' )", "returns":"'It is true (not empty)'"}
{ "expression":"if( 0, 'One', 'Zero' )", "returns":"'Zero'"}
{ "expression":"if( 10, 'One', 'Zero' )", "returns":"'One'"}
"examples": [
{ "expression":"if( 1+1=2, 'Yes', 'No' )", "returns":"'Yes'"},
{ "expression":"if( 1+1=3, 'Yes', 'No' )", "returns":"'No'"},
{ "expression":"if( 5 > 3, 1, 0)", "returns":"1"},
{ "expression":"if( '', 'It is true (not empty)', 'It is false (empty)' )", "returns":"'It is false (empty)'"},
{ "expression":"if( ' ', 'It is true (not empty)', 'It is false (empty)' )", "returns":"'It is true (not empty)'"},
{ "expression":"if( 0, 'One', 'Zero' )", "returns":"'Zero'"},
{ "expression":"if( 10, 'One', 'Zero' )", "returns":"'One'"}
]
}

0 comments on commit ec17e3c

Please sign in to comment.
You can’t perform that action at this time.