{"id":11113,"date":"2017-10-26T10:01:40","date_gmt":"2017-10-26T09:01:40","guid":{"rendered":"https:\/\/help.instantatlas.com\/report-builder-agol\/?page_id=11113"},"modified":"2025-10-01T10:52:14","modified_gmt":"2025-10-01T09:52:14","slug":"variables","status":"publish","type":"page","link":"https:\/\/help.reports.esriuk.com\/report-builder\/variables\/","title":{"rendered":"Variables"},"content":{"rendered":"<p>Report Builder can use a number of <strong>substitution variables<\/strong> in widgets. These allow you to add dynamic text into the widget, or, for <a href=\"https:\/\/help.instantatlas.com\/report-builder-agol\/widgets\/text-rules\/\">rule-based widgets<\/a>, to test data values and show different text or styles depending on the outcome.<\/p>\n<h3><strong>Text Widgets<\/strong><\/h3>\n<p>When you are editing a <strong>Text<\/strong> widget, there are two buttons that allow you to add variables. The first one is <strong>Insert feature value<\/strong>. It is used to insert the variables <code>#FNAMES<\/code> or <code>#FIDS<\/code> which get replaced with the name or ID of the selected feature. The second button is <strong>Insert indicator value<\/strong>. When clicked it will display a drop down list with all indicators that are available for this widget. If you select one of them, Report Builder inserts the variable <code>#IVALUE<\/code> which gets replaced with the value for the corresponding indicator for the selected feature.<\/p>\n<p>You can also add variables by manually typing them in as text. The tables below summarise the available variables for text widgets and what they do.<\/p>\n<table id=\"featureTextTable\">\n<tbody>\n<tr>\n<th colspan=\"2\">Features<\/th>\n<\/tr>\n<tr>\n<td><code>#FNAMES{, }<\/code><\/td>\n<td>Displays area name(s), separated by the character in the brackets, e.g. &#8220;, &#8220;. In most cases this will give a single area name i.e. the area being reported on.\u00a0 However, if you used this variable in say the title of a table widget and had &#8216;show all areas&#8217; selected in the data tab then all area names would be displayed.\u00a0 Note: in a text widget you can only display the area being reported on.<\/td>\n<\/tr>\n<tr>\n<td><code>#FNAME{x}<\/code><\/td>\n<td>Area name at index <em>x<\/em> (x is optional, you can use #FNAME if followed with a space, with #FNAME{1} being most useful). If used in a widget where you were displaying data for all areas you could pick out say the 5th area name using #FNAME{5}<\/td>\n<\/tr>\n<tr>\n<td><code>#FID{x}<\/code><\/td>\n<td>Area ID at index <em>x<\/em> (x is optional, you can use #FID if followed with a space, #FID{1} being most useful). So, for a county-level report, #FID{1} would give you\u00a0<em>E06000052<\/em> if you were viewing the report for\u00a0<em>Cornwall<\/em>.<\/td>\n<\/tr>\n<tr>\n<td><code>#CFNAME{x}<\/code><\/td>\n<td>Comparison Area Name at index <em>x<\/em> (<a href=\"#compIndex\">see below<\/a>). <strong>Note<\/strong>: The respective comparison relationship needs to be ticked under <strong>Use comparison features<\/strong> in the widget settings within the <strong>Basics<\/strong> settings group.<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<table id=\"TodayTable\">\n<tbody>\n<tr>\n<th colspan=\"2\">Today&#8217;s date<\/th>\n<\/tr>\n<tr>\n<td><code>#TODAY{yyyy}<\/code><\/td>\n<td>Displays today&#8217;s date as a four-digit year format for example <em>2022<\/em>. Can be used to specify <a href=\"#specificIndValue\">indicator values for the current date<\/a> where the latest available date is larger than the current date (e.g. projections).<\/td>\n<\/tr>\n<tr>\n<td><code>#TODAY{mm}<\/code><\/td>\n<td>Displays today&#8217;s date as a two-digit month format for example <em>02<\/em> (for February). Can be used to specify <a href=\"#specificIndValue\">indicator values for the current date<\/a> where the latest available date is larger than the current date (e.g. projections).<\/td>\n<\/tr>\n<tr>\n<td><code>#TODAY{mmm}<\/code><\/td>\n<td>Displays today&#8217;s date as a three-digit month format for example <em>Feb<\/em> (for February). Can be used to specify <a href=\"#specificIndValue\">indicator values for the current date<\/a> where the latest available date is larger than the current date (e.g. projections).<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<table id=\"indicatorTable\" style=\"width: 100%;\">\n<tbody>\n<tr>\n<th style=\"width: 660px;\" colspan=\"2\">Indicators<\/th>\n<\/tr>\n<tr id=\"indicatorIndex\">\n<td style=\"width: 262px;\" colspan=\"2\"><strong>Data Catalog Indicators<\/strong><\/td>\n<\/tr>\n<tr id=\"dataStoreIndicatorId\">\n<td style=\"width: 262px;\"><code>#INAME{catalog:Ixxx}<\/code><\/td>\n<td style=\"width: 398px;\"><strong>Indicator name<\/strong> from <a href=\"https:\/\/help.instantatlas.com\/report-builder-agol\/data-catalog\/\">data catalog<\/a>, <em>Ixxx<\/em> = the indicator&#8217;s unique ID &#8211;\u00a0 you can either get this by using the drop-down menu or by looking at the <em>metadata<\/em> for the indicator.<\/td>\n<\/tr>\n<tr>\n<td style=\"width: 262px;\"><code>#ILVALUE{catalog:Ixxx}<\/code><\/td>\n<td style=\"width: 398px;\"><strong>Indicator<\/strong> <strong>value<\/strong> for the <strong>latest<\/strong> <strong>date<\/strong> from data catalog, <em>Ixxx<\/em> = the indicator&#8217;s unique ID &#8211; (<a href=\"#dataStoreIndicatorId\">see above<\/a>)<\/td>\n<\/tr>\n<tr id=\"compIndex\">\n<td style=\"width: 262px;\"><code>#ILVALUE{catalog:Ixxx,Cy}<\/code><\/td>\n<td style=\"width: 398px;\"><strong>Comparison value<\/strong> for the <strong>latest date<\/strong> of the indicator from data catalog, the indicator&#8217;s unique ID &#8211; (<a href=\"#dataStoreIndicatorId\">see above<\/a>), <em>Cy<\/em> = comparison index (1 being the first comparator, which is normally one geographical level above, Wards &gt; District for example). <strong>Note<\/strong>: The respective comparison relationship needs to be ticked under <strong>Use comparison features<\/strong> in the widget settings within the <strong>Basics<\/strong> settings group.<\/td>\n<\/tr>\n<tr id=\"compIds\">\n<td style=\"width: 262px;\"><code>#ILVALUE{catalog:Ixxx,C:yyy}<\/code><\/td>\n<td style=\"width: 398px;\"><strong>Comparison value<\/strong> for the <strong>latest date<\/strong> of the indicator from data catalog, <em>Ixxx<\/em> = the indicator&#8217;s unique ID &#8211; (<a href=\"#dataStoreIndicatorId\">see above<\/a>), <em>C:yyy<\/em> = <a href=\"http:\/\/statistics.data.gov.uk\/\" target=\"_blank\" rel=\"noopener\">area code of comparison area<\/a> (for example, <em>C:E92000001<\/em> is England, <em>C:E06000052<\/em> is Cornwall). <strong>Note<\/strong>: The respective comparison relationship needs to be ticked under <strong>Use comparison features<\/strong> in the widget settings within the <strong>Basics<\/strong> settings group.<\/td>\n<\/tr>\n<tr>\n<td style=\"width: 262px;\"><code>#ILDATE{catalog:Ixxx}<\/code><\/td>\n<td style=\"width: 398px;\">Data\u00a0catalog <strong>latest date<\/strong> variant; <em>Ixxx<\/em> = the indicator&#8217;s unique ID &#8211; (<a href=\"#dataStoreIndicatorId\">see above<\/a>)<\/td>\n<\/tr>\n<tr id=\"specificIndValue\">\n<td style=\"width: 262px;\"><code>#IVALUE{catalog:Ixxx,y,zzzz}<\/code><\/td>\n<td style=\"width: 398px;\"><strong>Indicator value<\/strong> for a <strong>specific date<\/strong> from data catalog, <em>Ixxx<\/em> = the indicator&#8217;s unique ID &#8211; (<a href=\"#dataStoreIndicatorId\">see above<\/a>), y = feature index &#8211; in most cases 1, zzzz = the date as recorded in the data catalog (for example <em>2020<\/em>). The date argument can be replaced by one of the variables for <a href=\"#TodayTable\">Today&#8217;s date<\/a> providing the date in the data catalog matches that format (useful for projections where the latest available date is larger than the current date).<\/td>\n<\/tr>\n<tr id=\"compIndexspecificDate\">\n<td style=\"width: 262px;\"><code>#IVALUE{catalog:Ixxx,Cy,zzzz}<\/code><\/td>\n<td style=\"width: 398px;\"><strong>Comparison value<\/strong> for a <strong>specific date<\/strong> of the indicator from data catalog, the indicator&#8217;s unique ID &#8211; (<a href=\"#dataStoreIndicatorId\">see above<\/a>), <em>Cy<\/em> = comparison index (1 being the first comparator, which is normally one geographical level above, Wards &gt; District for example), zzzz = the date as recorded in the data catalog (for example <em>2020<\/em>). The date argument can be replaced by one of the variables for <a href=\"#TodayTable\">Today&#8217;s date<\/a> providing the date in the data catalog matches that format (useful for projections where the latest available date is larger than the current date). <strong>Note<\/strong>: The respective comparison relationship needs to be ticked under <strong>Use comparison features<\/strong> in the widget settings within the <strong>Basics<\/strong> settings group.<\/td>\n<\/tr>\n<tr id=\"compIdsspecificDate\">\n<td style=\"width: 262px;\"><code>#IVALUE{catalog:Ixxx,C:yyy,zzzz}<\/code><\/td>\n<td style=\"width: 398px;\"><strong>Comparison value<\/strong> for a <strong>specific date<\/strong> of the indicator from data catalog, <em>Ixxx<\/em> = the indicator&#8217;s unique ID &#8211; (<a href=\"#dataStoreIndicatorId\">see above<\/a>), <em>C:yyy<\/em> = <a href=\"http:\/\/statistics.data.gov.uk\/\" target=\"_blank\" rel=\"noopener\">area code of comparison area<\/a> (for example, <em>C:E92000001<\/em> is England, <em>C:E06000052<\/em> is Cornwall), zzzz = the date as recorded in the data catalog (for example <em>2020<\/em>). The date argument can be replaced by one of the variables for <a href=\"#TodayTable\">Today&#8217;s date<\/a> providing the date in the data catalog matches that format (useful for projections where the latest available date is larger than the current date). <strong>Note<\/strong>: The respective comparison relationship needs to be ticked under <strong>Use comparison features<\/strong> in the widget settings within the <strong>Basics<\/strong> settings group.<\/td>\n<\/tr>\n<tr>\n<td style=\"width: 262px;\" colspan=\"2\"><strong>CSV File or Feature Service Indicators<\/strong><\/td>\n<\/tr>\n<tr>\n<td style=\"width: 262px;\"><code>#IVALUE{x}<\/code><\/td>\n<td style=\"width: 398px;\">Indicator<strong>\u00a0value<\/strong> from feature service or CSV, <em>x<\/em> = indicator\/instance <em>field name<\/em> (column header). Example: #IVALUE{TOTAL_POP} will display the indicator value from the a field\/column named <em>TOTAL_POP<\/em> in the dataset.<\/td>\n<\/tr>\n<tr>\n<td style=\"width: 262px;\"><code>#IVALUE{x,C:y}<\/code><\/td>\n<td style=\"width: 398px;\">Comparison <strong>value<\/strong> for indicator value from CSV<!--, table or feature service--> data sources; <em>x<\/em> = field name, <em>y<\/em> = comparison feature ID. <strong>Note<\/strong>: The respective comparison feature needs to be ticked under <strong>Use comparison features<\/strong> in the widget settings within the <strong>Basics<\/strong> settings group.<\/td>\n<\/tr>\n<tr id=\"indicatorIndex\">\n<td style=\"width: 262px;\"><code>#IINAME{x}<\/code><\/td>\n<td style=\"width: 398px;\">Indicator <em>instance<\/em> <strong>name<\/strong> from feature service or CSV, <em>x<\/em> = indicator\/instance field name (column header).<\/td>\n<\/tr>\n<tr>\n<td style=\"width: 262px;\"><code>#IDATE{x}<\/code><\/td>\n<td style=\"width: 398px;\"><strong>Date<\/strong> value &#8211; non data catalog; <em>x<\/em> = indicator <em>instance<\/em> field name\u2013 (<a href=\"#indicatorIndex\">see above<\/a>)<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p style=\"font-size: .85em;\">Note: in version 1 of Report Builder variables using CSV or similar data used <em>{index}<\/em> rather than<em> {field_name}<\/em> to identify data values. This option is still available but it is <strong>strongly recommended<\/strong> that you use the <em>{field_name}<\/em> pattern instead as using <em>{index}<\/em> can give unpredictable results when data sources are updated. See also the <a href=\"\/report-builder\/reports-auto-migration-from-version-1-to-2\/\">auto-migration notes<\/a>.<\/p>\n<p><!--\n\n\n<h3><strong>Table Widgets<\/strong><\/h3>\n\n\nTable widgets have some special variants of these substitution variables for use in <a href=\"https:\/\/help.instantatlas.com\/report-builder-agol\/table-cell-color-rules\/\">table cell rules<\/a>. These can be used to <em>compare values within the same indicator<\/em>. So, if you use these values for table cell rules, the indicator index will always be 1 (one) which means <em>the indicator currently being inserted into the table<\/em>. That will mean either comparing values within a column, or within a row, depending on your table layout.\n\n\n<table>\n\n\n<tbody>\n\n\n<tr>\n\n\n<td><code>#CVALUE{x}<\/code><\/td>\n\n\n\n\n<td><a href=\"#compIndex\">as above<\/a> but <em>x<\/em> is the comparison index, indicator index is assumed (see other email)<\/td>\n\n\n<\/tr>\n\n\n\n\n<tr>\n\n\n<td><code>#CVALUEBYID{xxx}<\/code><\/td>\n\n\n\n\n<td><a href=\"#compIds\">as above<\/a> but <em>xxx<\/em> is the comparison ID, indicator index is assumed (see other email<\/td>\n\n\n<\/tr>\n\n\n<\/tbody>\n\n\n<\/table>\n\n\n--><\/p>\n<h3><strong>Other Widgets<\/strong><\/h3>\n<p>Other widgets can make use of variables in their settings. Examples are shown in the table below. For most of these widgets you must type the variables in manually.<\/p>\n<table style=\"width: 100%;\">\n<tbody>\n<tr>\n<td style=\"width: 21.2122%;\"><strong>Image<\/strong> widget<\/td>\n<td style=\"width: 78.6363%;\">You can use substitution variables in the <strong>URL<\/strong> to your image. This can give a quick way of embedding images that are specific to your report, for example:<\/p>\n<p><code>http:\/\/myserver\/images\/areas\/#FNAME{1}.png<\/code><\/p>\n<p><code>http:\/\/myserver\/images\/maps\/os_#FID{1}.png<\/code><\/td>\n<\/tr>\n<tr>\n<td style=\"width: 21.2122%;\"><strong>Text Box <\/strong>widget<\/td>\n<td style=\"width: 78.6363%;\">All of the substitution variables above can be used in the <strong>Title<\/strong> setting as well as in the message text.<\/td>\n<\/tr>\n<tr>\n<td style=\"width: 21.2122%;\"><strong>Web Map <\/strong>widget<\/td>\n<td style=\"width: 78.6363%;\">All of the substitution variables above can be used in the <strong>Title<\/strong> setting.<\/td>\n<\/tr>\n<tr>\n<td style=\"width: 21.2122%;\"><strong>Bar Chart and Line Chart <\/strong>widget<\/td>\n<td style=\"width: 78.6363%;\">If you wish to add confidence limit values to the tooltip you can use the variables <code>#YMIN<\/code> and <code>#YMAX<\/code>.<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p>&nbsp;<\/p>\n<h3>Number Format<\/h3>\n<p>For indicator values, you can specify the number format that you would like the value to be displayed with if you wish. This will take precedence over the number format that is set at the level of the widget itself (in the widget settings).<\/p>\n<p>In your substitution variable, you simply need to add <strong>;NF:<\/strong> followed by the desired number format.<\/p>\n<p>For example, if inserting an indicator value from a data catalog, and you wish to always display this with two decimal places:<\/p>\n<p><code>#ILVALUE{catalog:Ixxx;NF:###,###.00}<\/code><\/p>\n<p>Or if inserting an indicator value from a CSV file or feature service, it would look like this:<\/p>\n<p><code>#ILVALUE{catalog:x;NF:###,###.00}<\/code><\/p>\n<h3><\/h3>\n<h3>Metadata fields<\/h3>\n<p>For reports created using a data catalog as a data source, it is possible to use variables of the syntax <code>#IMETADATA{&lt;indicator-id&gt;,&lt;metadata-item&gt;}<\/code>\u00a0to insert field values from a connected metadata table into text widgets or text-based widgets settings such as the\u00a0<strong>Description<\/strong>\u00a0of charts. For example, the variable\u00a0<code>#IMETADATA{I20695,Creator}<\/code>\u00a0returns the value of the\u00a0<strong>Creator<\/strong>\u00a0field from the metadata table for the indicator with the ID I20695. The advantage is that, should the metadata field value be updated in the metadata table, the displayed text in the report will reflect this change.<\/p>\n<p><a class=\"oceanwp-lightbox\" href=\"https:\/\/help.reports.esriuk.com\/report-builder\/wp-content\/uploads\/sites\/51\/2025\/09\/Metadata-variables.png\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-large wp-image-11957\" src=\"https:\/\/help.reports.esriuk.com\/report-builder\/wp-content\/uploads\/sites\/51\/2025\/09\/Metadata-variables-1024x400.png\" sizes=\"auto, (max-width: 1024px) 100vw, 1024px\" srcset=\"https:\/\/help.reports.esriuk.com\/report-builder\/wp-content\/uploads\/sites\/51\/2025\/09\/Metadata-variables-1024x400.png 1024w, https:\/\/help.reports.esriuk.com\/report-builder\/wp-content\/uploads\/sites\/51\/2025\/09\/Metadata-variables-300x117.png 300w, https:\/\/help.reports.esriuk.com\/report-builder\/wp-content\/uploads\/sites\/51\/2025\/09\/Metadata-variables-768x300.png 768w, https:\/\/help.reports.esriuk.com\/report-builder\/wp-content\/uploads\/sites\/51\/2025\/09\/Metadata-variables.png 1072w\" alt=\"\" width=\"1024\" height=\"400\" data-lazy-loaded=\"true\" \/><\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<p>Report Builder can use a number of substitution variables in widgets. These allow you to add dynamic text into the widget, or, for rule-based widgets, to test data values and show different text or styles depending on the outcome. Text Widgets When you are editing a Text widget, there are two buttons that allow you [&hellip;]<\/p>\n","protected":false},"author":22,"featured_media":0,"parent":0,"menu_order":24,"comment_status":"closed","ping_status":"closed","template":"","meta":{"footnotes":""},"class_list":["post-11113","page","type-page","status-publish","hentry","entry"],"_links":{"self":[{"href":"https:\/\/help.reports.esriuk.com\/report-builder\/wp-json\/wp\/v2\/pages\/11113","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\/22"}],"replies":[{"embeddable":true,"href":"https:\/\/help.reports.esriuk.com\/report-builder\/wp-json\/wp\/v2\/comments?post=11113"}],"version-history":[{"count":0,"href":"https:\/\/help.reports.esriuk.com\/report-builder\/wp-json\/wp\/v2\/pages\/11113\/revisions"}],"wp:attachment":[{"href":"https:\/\/help.reports.esriuk.com\/report-builder\/wp-json\/wp\/v2\/media?parent=11113"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}