<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic HTML created conditional pop-ups do not seem to respect formatting in ArcGIS Dashboards Questions</title>
    <link>https://community.esri.com/t5/arcgis-dashboards-questions/html-created-conditional-pop-ups-do-not-seem-to/m-p/1249269#M7211</link>
    <description>&lt;P&gt;Hey everyone,&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Background&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;In a WebMap I have, I edited the pop-ups using HTML in order to conditionally show a field based on the results of a previous field.&amp;nbsp;&lt;/P&gt;&lt;P&gt;This feature layer refers to a layer from Survey123 points. In that survey, there is a section that is only applicable to be filled if the Province in question is "Alberta". Thus, those sections in the survey show conditionally.&amp;nbsp;&lt;/P&gt;&lt;P&gt;I wanted the pop-ups to also reflect this so that the Alberta only questions do not show for every feature regardless of location. I achieved this via HTML, however the issue I'm facing now is that by making those fields conditional in the pop-up, formatting no longer seems to be respected.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;Note that some information was removed/altered from the codes and screenshots for confidentiality.&amp;nbsp;&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;To achieve this, the first step was creating an expression to check if the Province is Alberta.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="c"&gt;var province = $feature.prov_state
IIf(Find("AB", province) == 0, "block", "none")&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;In this case, "block" means to show the section, and "none" means to hide it. Method was gathered from &lt;A href="https://community.esri.com/t5/arcgis-online-documents/conditional-field-display-with-arcade-in-pop-ups/ta-p/920869" target="_self"&gt;this thread&lt;/A&gt;.&lt;/P&gt;&lt;P&gt;Then, in the HTML code for the pop-up, I added the expression as a display attribute for the applicable elements.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;&amp;lt;div style="background-color:#e91d2d;color:#ffffff;display:{expression/expr0};padding:5px;text-align:center;"&amp;gt;
    &amp;lt;strong&amp;gt;Alberta Point&amp;lt;/strong&amp;gt;
&amp;lt;/div&amp;gt;&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;This makes the divider only show if the feature is in Alberta.&amp;nbsp;&lt;/P&gt;&lt;P&gt;I did the same for the actual table contents:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;&amp;lt;figure class="table"&amp;gt;
    &amp;lt;table style="display:{expression/expr0};table-layout:fixed;width:100%;"&amp;gt;
        &amp;lt;tbody&amp;gt;
            &amp;lt;tr valign="top"&amp;gt;
                &amp;lt;td style="padding:2px 10px 2px 2px;text-align:right;width:50%;"&amp;gt;
					AB Point Field A
                &amp;lt;/td&amp;gt;
                &amp;lt;td style="padding:2px;text-align:left;width:50%;"&amp;gt;
					&amp;lt;strong&amp;gt;{ab_field_a}&amp;lt;/strong&amp;gt;
                &amp;lt;/td&amp;gt;
            &amp;lt;/tr&amp;gt;
        &amp;lt;/tbody&amp;gt;
    &amp;lt;/table&amp;gt;
&amp;lt;/figure&amp;gt;&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Problem&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;Though formatting worked fine in the pop-up, in the dashboard for this data, none of the formatting was respected, and everything was left aligned (see screenshot 1).&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="deshboard_screenshot_1.png" style="width: 400px;"&gt;&lt;img src="https://community.esri.com/t5/image/serverpage/image-id/60693i6CE572E80D514FF2/image-size/medium?v=v2&amp;amp;px=400" role="button" title="deshboard_screenshot_1.png" alt="deshboard_screenshot_1.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;Note that in addition to not working in the dashboard, there is an additional field that doesn't respect formatting in either the map viewer pop-up or the dashboard viewer.&amp;nbsp;&lt;/P&gt;&lt;P&gt;That item is a conditional field that lives in a table where all other fields are &lt;STRONG&gt;not&lt;/STRONG&gt; conditional. To apply the conditional expression, I added the display attribute in the &amp;lt;tr&amp;gt; tag for the field as opposed to the table tag:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;&amp;lt;tr style="display:{expression/expr0};" valign="top"&amp;gt;
    &amp;lt;td style="padding:2px 10px 2px 2px;text-align:right;width:50%;"&amp;gt;                          
		AB Notified
    &amp;lt;/td&amp;gt;
    &amp;lt;td style="padding:2px;text-align:left;width:50%;"&amp;gt;       
		&amp;lt;strong&amp;gt;{notify_ab}&amp;lt;/strong&amp;gt;
    &amp;lt;/td&amp;gt;
&amp;lt;/tr&amp;gt;&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;As seen in the second (map viewer pop-up) and third (dashboard) screenshots, the text-align calls are not respected and everything is pushed left.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="map_viewer_screenshot_1.png" style="width: 400px;"&gt;&lt;img src="https://community.esri.com/t5/image/serverpage/image-id/60691iF2941CA986663276/image-size/medium?v=v2&amp;amp;px=400" role="button" title="map_viewer_screenshot_1.png" alt="map_viewer_screenshot_1.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="deshboard_screenshot_2.png" style="width: 400px;"&gt;&lt;img src="https://community.esri.com/t5/image/serverpage/image-id/60690iC6E715FA40412922/image-size/medium?v=v2&amp;amp;px=400" role="button" title="deshboard_screenshot_2.png" alt="deshboard_screenshot_2.png" /&gt;&lt;/span&gt;  &lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Questions&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;Is it not possible for HTML tags to retain formatting when conditional expressions are added to it?&lt;/P&gt;&lt;P&gt;Is there a limitation for dashboards to not respect HTML formatting for conditional expressions?&lt;/P&gt;&lt;P&gt;Furthermore, why does formatting seem to be respected (at least in map viewer) when the conditional expression is added to the overall table (&amp;lt;table&amp;gt; tag), but not when it's added to individual rows of a table (&amp;lt;td&amp;gt; tag)?&lt;/P&gt;&lt;P&gt;I should preface this by saying I have quite basic HTML and Arcade experience. Hopefully I'm just missing something obvious.&lt;/P&gt;&lt;P&gt;An excerpt of the HTML code for the conditional table and the non-conditional table with a single conditional field is attached as a zip file (forums wouldn't let me upload as txt or html). Note that field and display names have been changed for confidentiality.&lt;/P&gt;&lt;P&gt;Any help is appreciated. Thanks in advance!&lt;/P&gt;</description>
    <pubDate>Wed, 18 Jan 2023 21:39:44 GMT</pubDate>
    <dc:creator>Vince_ERAC</dc:creator>
    <dc:date>2023-01-18T21:39:44Z</dc:date>
    <item>
      <title>HTML created conditional pop-ups do not seem to respect formatting</title>
      <link>https://community.esri.com/t5/arcgis-dashboards-questions/html-created-conditional-pop-ups-do-not-seem-to/m-p/1249269#M7211</link>
      <description>&lt;P&gt;Hey everyone,&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Background&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;In a WebMap I have, I edited the pop-ups using HTML in order to conditionally show a field based on the results of a previous field.&amp;nbsp;&lt;/P&gt;&lt;P&gt;This feature layer refers to a layer from Survey123 points. In that survey, there is a section that is only applicable to be filled if the Province in question is "Alberta". Thus, those sections in the survey show conditionally.&amp;nbsp;&lt;/P&gt;&lt;P&gt;I wanted the pop-ups to also reflect this so that the Alberta only questions do not show for every feature regardless of location. I achieved this via HTML, however the issue I'm facing now is that by making those fields conditional in the pop-up, formatting no longer seems to be respected.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;Note that some information was removed/altered from the codes and screenshots for confidentiality.&amp;nbsp;&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;To achieve this, the first step was creating an expression to check if the Province is Alberta.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="c"&gt;var province = $feature.prov_state
IIf(Find("AB", province) == 0, "block", "none")&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;In this case, "block" means to show the section, and "none" means to hide it. Method was gathered from &lt;A href="https://community.esri.com/t5/arcgis-online-documents/conditional-field-display-with-arcade-in-pop-ups/ta-p/920869" target="_self"&gt;this thread&lt;/A&gt;.&lt;/P&gt;&lt;P&gt;Then, in the HTML code for the pop-up, I added the expression as a display attribute for the applicable elements.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;&amp;lt;div style="background-color:#e91d2d;color:#ffffff;display:{expression/expr0};padding:5px;text-align:center;"&amp;gt;
    &amp;lt;strong&amp;gt;Alberta Point&amp;lt;/strong&amp;gt;
&amp;lt;/div&amp;gt;&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;This makes the divider only show if the feature is in Alberta.&amp;nbsp;&lt;/P&gt;&lt;P&gt;I did the same for the actual table contents:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;&amp;lt;figure class="table"&amp;gt;
    &amp;lt;table style="display:{expression/expr0};table-layout:fixed;width:100%;"&amp;gt;
        &amp;lt;tbody&amp;gt;
            &amp;lt;tr valign="top"&amp;gt;
                &amp;lt;td style="padding:2px 10px 2px 2px;text-align:right;width:50%;"&amp;gt;
					AB Point Field A
                &amp;lt;/td&amp;gt;
                &amp;lt;td style="padding:2px;text-align:left;width:50%;"&amp;gt;
					&amp;lt;strong&amp;gt;{ab_field_a}&amp;lt;/strong&amp;gt;
                &amp;lt;/td&amp;gt;
            &amp;lt;/tr&amp;gt;
        &amp;lt;/tbody&amp;gt;
    &amp;lt;/table&amp;gt;
&amp;lt;/figure&amp;gt;&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Problem&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;Though formatting worked fine in the pop-up, in the dashboard for this data, none of the formatting was respected, and everything was left aligned (see screenshot 1).&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="deshboard_screenshot_1.png" style="width: 400px;"&gt;&lt;img src="https://community.esri.com/t5/image/serverpage/image-id/60693i6CE572E80D514FF2/image-size/medium?v=v2&amp;amp;px=400" role="button" title="deshboard_screenshot_1.png" alt="deshboard_screenshot_1.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;Note that in addition to not working in the dashboard, there is an additional field that doesn't respect formatting in either the map viewer pop-up or the dashboard viewer.&amp;nbsp;&lt;/P&gt;&lt;P&gt;That item is a conditional field that lives in a table where all other fields are &lt;STRONG&gt;not&lt;/STRONG&gt; conditional. To apply the conditional expression, I added the display attribute in the &amp;lt;tr&amp;gt; tag for the field as opposed to the table tag:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;&amp;lt;tr style="display:{expression/expr0};" valign="top"&amp;gt;
    &amp;lt;td style="padding:2px 10px 2px 2px;text-align:right;width:50%;"&amp;gt;                          
		AB Notified
    &amp;lt;/td&amp;gt;
    &amp;lt;td style="padding:2px;text-align:left;width:50%;"&amp;gt;       
		&amp;lt;strong&amp;gt;{notify_ab}&amp;lt;/strong&amp;gt;
    &amp;lt;/td&amp;gt;
&amp;lt;/tr&amp;gt;&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;As seen in the second (map viewer pop-up) and third (dashboard) screenshots, the text-align calls are not respected and everything is pushed left.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="map_viewer_screenshot_1.png" style="width: 400px;"&gt;&lt;img src="https://community.esri.com/t5/image/serverpage/image-id/60691iF2941CA986663276/image-size/medium?v=v2&amp;amp;px=400" role="button" title="map_viewer_screenshot_1.png" alt="map_viewer_screenshot_1.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="deshboard_screenshot_2.png" style="width: 400px;"&gt;&lt;img src="https://community.esri.com/t5/image/serverpage/image-id/60690iC6E715FA40412922/image-size/medium?v=v2&amp;amp;px=400" role="button" title="deshboard_screenshot_2.png" alt="deshboard_screenshot_2.png" /&gt;&lt;/span&gt;  &lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Questions&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;Is it not possible for HTML tags to retain formatting when conditional expressions are added to it?&lt;/P&gt;&lt;P&gt;Is there a limitation for dashboards to not respect HTML formatting for conditional expressions?&lt;/P&gt;&lt;P&gt;Furthermore, why does formatting seem to be respected (at least in map viewer) when the conditional expression is added to the overall table (&amp;lt;table&amp;gt; tag), but not when it's added to individual rows of a table (&amp;lt;td&amp;gt; tag)?&lt;/P&gt;&lt;P&gt;I should preface this by saying I have quite basic HTML and Arcade experience. Hopefully I'm just missing something obvious.&lt;/P&gt;&lt;P&gt;An excerpt of the HTML code for the conditional table and the non-conditional table with a single conditional field is attached as a zip file (forums wouldn't let me upload as txt or html). Note that field and display names have been changed for confidentiality.&lt;/P&gt;&lt;P&gt;Any help is appreciated. Thanks in advance!&lt;/P&gt;</description>
      <pubDate>Wed, 18 Jan 2023 21:39:44 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-dashboards-questions/html-created-conditional-pop-ups-do-not-seem-to/m-p/1249269#M7211</guid>
      <dc:creator>Vince_ERAC</dc:creator>
      <dc:date>2023-01-18T21:39:44Z</dc:date>
    </item>
    <item>
      <title>Re: HTML created conditional pop-ups do not seem to respect formatting</title>
      <link>https://community.esri.com/t5/arcgis-dashboards-questions/html-created-conditional-pop-ups-do-not-seem-to/m-p/1249502#M7215</link>
      <description>&lt;P&gt;In the other thread I had in ArcGIS Online forum &lt;STRONG&gt;&lt;A href="https://community.esri.com/t5/arcgis-online-questions/html-created-conditional-pop-ups-do-not-seem-to/m-p/1249262/thread-id/49837#M49841" target="_self"&gt;linked HERE&lt;/A&gt;&lt;/STRONG&gt;.&lt;/P&gt;&lt;P&gt;User,&amp;nbsp;&lt;a href="https://community.esri.com/t5/user/viewprofilepage/user-id/294341"&gt;@JohannesLindner&lt;/a&gt;&amp;nbsp;provided a solution! Pasted below. Thanks a bunch Johannes!&lt;/P&gt;&lt;P&gt;----------------------------------------------------------------------------------&lt;/P&gt;&lt;BLOCKQUOTE&gt;&lt;P&gt;&lt;SPAN&gt;Is it not possible for HTML tags to retain formatting when conditional expressions are added to it?&lt;/SPAN&gt;&lt;/P&gt;&lt;/BLOCKQUOTE&gt;&lt;P&gt;The CSS display attribute has many possible values. Take a look:&amp;nbsp;&lt;A href="https://www.w3schools.com/cssref/pr_class_display.php" target="_blank" rel="nofollow noopener noreferrer"&gt;CSS display property (w3schools.com)&lt;/A&gt;&lt;/P&gt;&lt;P&gt;It's important to choose the right one. You are using block. This basically displays the element as though it were a paragaph (&amp;lt;p&amp;gt; tag), which probably messes with the formatting.&lt;/P&gt;&lt;P&gt;Try to use&amp;nbsp;&lt;/P&gt;&lt;UL&gt;&lt;LI&gt;"display: table;" for the table conditional&lt;/LI&gt;&lt;LI&gt;"display: table-row" for the tr conditional&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;BLOCKQUOTE&gt;&lt;P&gt;&lt;SPAN&gt;Is there a limitation for dashboards to not respect HTML formatting for conditional expressions?&lt;/SPAN&gt;&lt;/P&gt;&lt;/BLOCKQUOTE&gt;&lt;P&gt;&lt;SPAN&gt;There are some limitations for what you can do with HTML in ArcGIS products. But this doesn't seem like one of them.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;BLOCKQUOTE&gt;&lt;P&gt;&lt;SPAN&gt;why does formatting seem to be respected (at least in map viewer) when the conditional expression is added to the overall table (&amp;lt;table&amp;gt; tag), but not when it's added to individual rows of a table (&amp;lt;td&amp;gt; tag)?&lt;/SPAN&gt;&lt;/P&gt;&lt;/BLOCKQUOTE&gt;&lt;P&gt;&lt;SPAN&gt;Rendering HTML and CSS is a tricky thing. Every browser does it a little differently, and as you discovered, even apllications from the same vendor can handle it differently. For us non-web-developers, these corner cases often come down to trial and error.&lt;/SPAN&gt;&lt;/P&gt;&lt;DIV class=""&gt;&lt;BR /&gt;Have a great day!&lt;BR /&gt;Johannes&lt;/DIV&gt;</description>
      <pubDate>Thu, 19 Jan 2023 15:45:16 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-dashboards-questions/html-created-conditional-pop-ups-do-not-seem-to/m-p/1249502#M7215</guid>
      <dc:creator>Vince_ERAC</dc:creator>
      <dc:date>2023-01-19T15:45:16Z</dc:date>
    </item>
  </channel>
</rss>

