{"id":1111,"date":"2015-09-16T15:45:41","date_gmt":"2015-09-16T14:45:41","guid":{"rendered":"http:\/\/help.instantatlas.com\/report-builder-agol\/?page_id=1111"},"modified":"2023-07-20T15:49:28","modified_gmt":"2023-07-20T14:49:28","slug":"text-rules","status":"publish","type":"page","link":"https:\/\/help.reports.esriuk.com\/report-builder\/widgets\/text-rules\/","title":{"rendered":"Text Rules"},"content":{"rendered":"<p>For <strong>Text<\/strong> and <strong>Text Box<\/strong> widgets, it is possible to define rules that allow you to display different text based on the data. Click the <strong>Edit text rules<\/strong> button in the text editor toolbar that shows above the widget when you are editing the text &#8211; this will open the <strong>Edit text rules<\/strong> window.<\/p>\n<p><a href=\"https:\/\/help.reports.esriuk.com\/report-builder\/wp-content\/uploads\/sites\/51\/2023\/07\/rb-2-6-text-rules7.png\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-11814\" src=\"https:\/\/help.reports.esriuk.com\/report-builder\/wp-content\/uploads\/sites\/51\/2023\/07\/rb-2-6-text-rules7.png\" alt=\"Text rules button\" width=\"469\" height=\"69\" srcset=\"https:\/\/help.reports.esriuk.com\/report-builder\/wp-content\/uploads\/sites\/51\/2023\/07\/rb-2-6-text-rules7.png 469w, https:\/\/help.reports.esriuk.com\/report-builder\/wp-content\/uploads\/sites\/51\/2023\/07\/rb-2-6-text-rules7-300x44.png 300w\" sizes=\"auto, (max-width: 469px) 100vw, 469px\" \/><\/a><\/p>\n<p>We will use an example taken from <a href=\"https:\/\/www.reports.esriuk.com\/view-report\/f6e4c5a86d9345f9af4f32080549ba81\/AL\">this report<\/a> showing data from the US Census Bureau. The demographics section shows a paragraph of text that compares the value for the selected feature with that of a comparison feature (United States).<\/p>\n<p>If Alabama is the selected feature, the paragraph shows the word &#8220;lower&#8221;.<\/p>\n<p><a href=\"https:\/\/help.reports.esriuk.com\/report-builder\/wp-content\/uploads\/sites\/51\/2023\/07\/rb-2-6-text-rules1.png\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-11808\" src=\"https:\/\/help.reports.esriuk.com\/report-builder\/wp-content\/uploads\/sites\/51\/2023\/07\/rb-2-6-text-rules1.png\" alt=\"Report Builder text rules example\" width=\"736\" height=\"300\" srcset=\"https:\/\/help.reports.esriuk.com\/report-builder\/wp-content\/uploads\/sites\/51\/2023\/07\/rb-2-6-text-rules1.png 736w, https:\/\/help.reports.esriuk.com\/report-builder\/wp-content\/uploads\/sites\/51\/2023\/07\/rb-2-6-text-rules1-300x122.png 300w\" sizes=\"auto, (max-width: 736px) 100vw, 736px\" \/><\/a><\/p>\n<p>Whereas if California is the selected feature, the paragraph shows the word &#8220;higher&#8221;.<\/p>\n<p><a href=\"https:\/\/help.reports.esriuk.com\/report-builder\/wp-content\/uploads\/sites\/51\/2023\/07\/rb-2-6-text-rules5.png\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-11812\" src=\"https:\/\/help.reports.esriuk.com\/report-builder\/wp-content\/uploads\/sites\/51\/2023\/07\/rb-2-6-text-rules5.png\" alt=\"Report Builder text rules example\" width=\"735\" height=\"305\" srcset=\"https:\/\/help.reports.esriuk.com\/report-builder\/wp-content\/uploads\/sites\/51\/2023\/07\/rb-2-6-text-rules5.png 735w, https:\/\/help.reports.esriuk.com\/report-builder\/wp-content\/uploads\/sites\/51\/2023\/07\/rb-2-6-text-rules5-300x124.png 300w\" sizes=\"auto, (max-width: 735px) 100vw, 735px\" \/><\/a><\/p>\n<p>The words &#8220;lower&#8221; and &#8220;higher&#8221; are determined by a text rule. When the widget is edited, the <strong>Edit text rules<\/strong> window contains two rules. The first rule is shown below. It defines that the text will show the word &#8220;higher&#8221; if the data in the widget matches the rule i.e. the population change value for the selected area is higher than that for the United Sates. The value in the first box is <em>#IVALUE{Population Change|2010}<\/em>. The operator chosen in this case is greater than (&gt;). The value in the third box is <em>#IVALUE{Population Change|2010,C:US}<\/em>. The forth box applies a multiplier of 1 (in some cases it is useful to be able to apply a different multiplier). If you are not sure how the substitution variables work, you can find more detail in our <a href=\"https:\/\/help.reports.esriuk.com\/report-builder\/variables\/\">Variables<\/a> page.<\/p>\n<p><a href=\"https:\/\/help.reports.esriuk.com\/report-builder\/wp-content\/uploads\/sites\/51\/2023\/07\/rb-2-6-text-rules2.png\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-11809\" src=\"https:\/\/help.reports.esriuk.com\/report-builder\/wp-content\/uploads\/sites\/51\/2023\/07\/rb-2-6-text-rules2.png\" alt=\"Text rule 1\" width=\"825\" height=\"475\" srcset=\"https:\/\/help.reports.esriuk.com\/report-builder\/wp-content\/uploads\/sites\/51\/2023\/07\/rb-2-6-text-rules2.png 825w, https:\/\/help.reports.esriuk.com\/report-builder\/wp-content\/uploads\/sites\/51\/2023\/07\/rb-2-6-text-rules2-300x173.png 300w, https:\/\/help.reports.esriuk.com\/report-builder\/wp-content\/uploads\/sites\/51\/2023\/07\/rb-2-6-text-rules2-768x442.png 768w\" sizes=\"auto, (max-width: 825px) 100vw, 825px\" \/><\/a><\/p>\n<p>If the data in the widget does not match the first rule, Report Builder will move on to the next rule. The second rule is shown below. It defines that the text will show the word &#8220;lower&#8221; if the data in the widget matches the rule i.e. the population change value for the selected area is lower than that for the United Sates. The values in the first and third boxes are the same as for the first rule, but the operator is now less than (&lt;).<\/p>\n<p><a href=\"https:\/\/help.reports.esriuk.com\/report-builder\/wp-content\/uploads\/sites\/51\/2023\/07\/rb-2-6-text-rules3.png\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-11810\" src=\"https:\/\/help.reports.esriuk.com\/report-builder\/wp-content\/uploads\/sites\/51\/2023\/07\/rb-2-6-text-rules3.png\" alt=\"Text rule 2\" width=\"826\" height=\"474\" srcset=\"https:\/\/help.reports.esriuk.com\/report-builder\/wp-content\/uploads\/sites\/51\/2023\/07\/rb-2-6-text-rules3.png 826w, https:\/\/help.reports.esriuk.com\/report-builder\/wp-content\/uploads\/sites\/51\/2023\/07\/rb-2-6-text-rules3-300x172.png 300w, https:\/\/help.reports.esriuk.com\/report-builder\/wp-content\/uploads\/sites\/51\/2023\/07\/rb-2-6-text-rules3-768x441.png 768w\" sizes=\"auto, (max-width: 826px) 100vw, 826px\" \/><\/a><\/p>\n<p>If the data in the widget does not match the second rule, Report Builder will move on to the next rule. As in this case there are only two rules, Report Builder will move on to the fallback text. The fallback text is shown below.<\/p>\n<p><a href=\"https:\/\/help.reports.esriuk.com\/report-builder\/wp-content\/uploads\/sites\/51\/2023\/07\/rb-2-6-text-rules4.png\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-11811\" src=\"https:\/\/help.reports.esriuk.com\/report-builder\/wp-content\/uploads\/sites\/51\/2023\/07\/rb-2-6-text-rules4.png\" alt=\"Text rules fallback text\" width=\"827\" height=\"305\" srcset=\"https:\/\/help.reports.esriuk.com\/report-builder\/wp-content\/uploads\/sites\/51\/2023\/07\/rb-2-6-text-rules4.png 827w, https:\/\/help.reports.esriuk.com\/report-builder\/wp-content\/uploads\/sites\/51\/2023\/07\/rb-2-6-text-rules4-300x111.png 300w, https:\/\/help.reports.esriuk.com\/report-builder\/wp-content\/uploads\/sites\/51\/2023\/07\/rb-2-6-text-rules4-768x283.png 768w\" sizes=\"auto, (max-width: 827px) 100vw, 827px\" \/><\/a><\/p>\n<p>You can create add as many rules as you need. There are lots of other operators available to suit different data and scenarios.<\/p>\n<p><a href=\"https:\/\/help.reports.esriuk.com\/report-builder\/wp-content\/uploads\/sites\/51\/2023\/07\/rb-2-6-text-rules6.png\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-11813\" src=\"https:\/\/help.reports.esriuk.com\/report-builder\/wp-content\/uploads\/sites\/51\/2023\/07\/rb-2-6-text-rules6.png\" alt=\"Text rule operators\" width=\"216\" height=\"292\" \/><\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<p>For Text and Text Box widgets, it is possible to define rules that allow you to display different text based on the data. Click the Edit text rules button in the text editor toolbar that shows above the widget when you are editing the text &#8211; this will open the Edit text rules window. We [&hellip;]<\/p>\n","protected":false},"author":61,"featured_media":0,"parent":4321,"menu_order":24,"comment_status":"closed","ping_status":"closed","template":"","meta":{"footnotes":""},"class_list":["post-1111","page","type-page","status-publish","hentry","entry"],"_links":{"self":[{"href":"https:\/\/help.reports.esriuk.com\/report-builder\/wp-json\/wp\/v2\/pages\/1111","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/help.reports.esriuk.com\/report-builder\/wp-json\/wp\/v2\/pages"}],"about":[{"href":"https:\/\/help.reports.esriuk.com\/report-builder\/wp-json\/wp\/v2\/types\/page"}],"author":[{"embeddable":true,"href":"https:\/\/help.reports.esriuk.com\/report-builder\/wp-json\/wp\/v2\/users\/61"}],"replies":[{"embeddable":true,"href":"https:\/\/help.reports.esriuk.com\/report-builder\/wp-json\/wp\/v2\/comments?post=1111"}],"version-history":[{"count":0,"href":"https:\/\/help.reports.esriuk.com\/report-builder\/wp-json\/wp\/v2\/pages\/1111\/revisions"}],"up":[{"embeddable":true,"href":"https:\/\/help.reports.esriuk.com\/report-builder\/wp-json\/wp\/v2\/pages\/4321"}],"wp:attachment":[{"href":"https:\/\/help.reports.esriuk.com\/report-builder\/wp-json\/wp\/v2\/media?parent=1111"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}