{"id":644,"date":"2021-02-19T10:35:12","date_gmt":"2021-02-19T10:35:12","guid":{"rendered":"http:\/\/167.71.55.215\/?page_id=644"},"modified":"2023-05-01T12:40:27","modified_gmt":"2023-05-01T12:40:27","slug":"truthy-values","status":"publish","type":"page","link":"https:\/\/info.documotor.com\/?page_id=644","title":{"rendered":"Truthy Values"},"content":{"rendered":"\n<p>DocuMotor uses &#8216;truthy values&#8217; in various cases such as visibility of elements. The following values are not truthy for direct values.<\/p>\n\n\n\n<ul><li><code>null<\/code><\/li><li><code>\"\"<\/code><\/li><li>&#8220;false&#8221;<\/li><li>&#8220;null&#8221;<\/li><li>false<\/li><li>0<\/li><\/ul>\n\n\n\n<p>In case the JSON path leads to an array, the array is not truthy if the array has 0 or &#8216;null&#8217; elements. <\/p>\n\n\n\n<p>Below are a few JSON examples where the truthy will evaluate <code>false<\/code>:<\/p>\n\n\n\n<pre title=\"Data\" class=\"wp-block-code\"><code class=\" line-numbers\">{\n     \"MyArray\": [],\n     \"MyOtherArray\": null,\n     \"MyInteger\": 0,\n     \"MyOtherInteger\": null,\n     \"MyBoolean\": false,\n     \"MyOtherBoolean\": null,\n     \"MyString\": \"\",\n     \"MyOtherString\": null,\n     \"MyDecimalNumber\": 0,\n     \"MyOtherDecimalNumber\": null\n }<\/code><\/pre>\n\n\n\n<p>And the same example, but where the truthy value will evaluate <code>true<\/code>:<\/p>\n\n\n\n<pre title=\"Data\" class=\"wp-block-code\"><code class=\" line-numbers\">{\n     \"MyArray\": [\n         1,\n         2,\n         3,\n         4\n     ],\n     \"MyOtherArray\": [\n         {\n             \"Fruits\": \"Apples\",\n             \"Amount\": 10\n         },\n         {\n             \"Fruits\": \"Bananas\",\n             \"Amount\": 5\n         }\n     ],\n     \"MyInteger\": 10,\n     \"MyOtherInteger\": -20,\n     \"MyBoolean\": true,\n     \"MyOtherBoolean\": true,\n     \"MyString\": \"Lorem ipsum\",\n     \"MyOtherString\": \"Dolor sit amet \\n Bacon Ipsum\",\n     \"MyDecimalNumber\": 1.0,\n     \"MyOtherDecimalNumber\": 0.5\n }<\/code><\/pre>\n\n\n\n<p><\/p>\n","protected":false},"excerpt":{"rendered":"<p>DocuMotor uses &#8216;truthy values&#8217; in various cases such as visibility of elements. The following values are not truthy for direct values. null &#8220;&#8221; &#8220;false&#8221; &#8220;null&#8221; false 0 In case the JSON path leads to an array, the array is not truthy if the array has 0 or &#8216;null&#8217; elements. Below are a few JSON examples [&hellip;]<\/p>\n","protected":false},"author":2,"featured_media":0,"parent":2252,"menu_order":10,"comment_status":"closed","ping_status":"closed","template":"","meta":[],"_links":{"self":[{"href":"https:\/\/info.documotor.com\/index.php?rest_route=\/wp\/v2\/pages\/644"}],"collection":[{"href":"https:\/\/info.documotor.com\/index.php?rest_route=\/wp\/v2\/pages"}],"about":[{"href":"https:\/\/info.documotor.com\/index.php?rest_route=\/wp\/v2\/types\/page"}],"author":[{"embeddable":true,"href":"https:\/\/info.documotor.com\/index.php?rest_route=\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/info.documotor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=644"}],"version-history":[{"count":8,"href":"https:\/\/info.documotor.com\/index.php?rest_route=\/wp\/v2\/pages\/644\/revisions"}],"predecessor-version":[{"id":5481,"href":"https:\/\/info.documotor.com\/index.php?rest_route=\/wp\/v2\/pages\/644\/revisions\/5481"}],"up":[{"embeddable":true,"href":"https:\/\/info.documotor.com\/index.php?rest_route=\/wp\/v2\/pages\/2252"}],"wp:attachment":[{"href":"https:\/\/info.documotor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=644"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}