<?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 How to make attributes without values not to be shown? in ArcGIS JavaScript Maps SDK Questions</title>
    <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/how-to-make-attributes-without-values-not-to-be/m-p/490164#M45550</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello!&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I´m going to explain question a bit further.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I made a side bar where I´m showing all my content from pop up (which is turned off). We chose few of attributes we want to show within the sidebar, but the problem is that not all features have values under all those attributes, so now they are just shown as empty.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Bigger problem are the links, since we have 2 attributes showing links to external documents (with clickable text "More info").&lt;/P&gt;&lt;P&gt;Now, no matter if there is a link in the table for that feature or not, both link attributes are shown, both with clickable text, from which only one is right or none (as some don´t have any external links).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I would like a solution where I can write in the code, if attribute is without value not to be shown, those ones with values to be shown. I´ve tried with different combinations of IF ELSE, but didn´t work, I just lack experience.&lt;/P&gt;&lt;P&gt;Here´s the part of the code with attributes in JS:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;var other = new InfoTemplate("",
&amp;nbsp; // OTHER ATTRIBUTES
&amp;nbsp; "&amp;nbsp;&amp;lt;b&amp;gt;Name&amp;lt;/b&amp;gt;:&amp;lt;br&amp;gt;&amp;nbsp;${Name}" + "&amp;lt;br&amp;gt;" + "&amp;lt;br&amp;gt;" +
&amp;nbsp; "&amp;amp;nbsp&amp;lt;b&amp;gt;Map layer&amp;lt;/b&amp;gt;:&amp;lt;br&amp;gt;&amp;nbsp;${Map_layer}"+ "&amp;lt;br&amp;gt;" + "&amp;lt;br&amp;gt;" +
&amp;nbsp; "&amp;amp;nbsp&amp;lt;b&amp;gt;Classification&amp;lt;/b&amp;gt;:&amp;lt;br&amp;gt;&amp;nbsp;${Classification}"+ "&amp;lt;br&amp;gt;" + "&amp;lt;br&amp;gt;" +
&amp;nbsp; "&amp;amp;nbsp&amp;lt;b&amp;gt;Assesment&amp;lt;/b&amp;gt;:&amp;lt;br&amp;gt;&amp;nbsp;${Assesment}" + "&amp;lt;br&amp;gt;" + "&amp;lt;br&amp;gt;" +
&amp;nbsp; "&amp;nbsp;&amp;lt;b&amp;gt;Justification&amp;lt;/b&amp;gt;:&amp;lt;br&amp;gt;&amp;nbsp;${Justification}" + "&amp;lt;br&amp;gt;" + "&amp;lt;br&amp;gt;" +
&amp;nbsp; "&amp;nbsp;&amp;lt;b&amp;gt;Link&amp;lt;/b&amp;gt;:&amp;lt;br&amp;gt;&amp;nbsp;&amp;lt;a href=${Link} target=_blank&amp;gt;More info&amp;lt;/a&amp;gt;" + "&amp;lt;br&amp;gt;" + "&amp;lt;br&amp;gt;" +
&amp;nbsp; "&amp;nbsp;&amp;lt;b&amp;gt;Link2&amp;lt;/b&amp;gt;:&amp;lt;br&amp;gt;&amp;nbsp;&amp;lt;a href=${Link2} target=_blank&amp;gt;More info&amp;lt;/a&amp;gt;" + "&amp;lt;br&amp;gt;" + "&amp;lt;br&amp;gt;" +
&amp;nbsp; "&amp;amp;nbsp&amp;lt;b&amp;gt;Contact person&amp;lt;/b&amp;gt;:&amp;lt;br&amp;gt;&amp;nbsp;${Contact_person}"

&amp;nbsp;&amp;nbsp; );&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Help is much appreciated! Thanks!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Sat, 11 Dec 2021 21:34:47 GMT</pubDate>
    <dc:creator>NedimNasic_Kjellgren</dc:creator>
    <dc:date>2021-12-11T21:34:47Z</dc:date>
    <item>
      <title>How to make attributes without values not to be shown?</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/how-to-make-attributes-without-values-not-to-be/m-p/490164#M45550</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello!&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I´m going to explain question a bit further.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I made a side bar where I´m showing all my content from pop up (which is turned off). We chose few of attributes we want to show within the sidebar, but the problem is that not all features have values under all those attributes, so now they are just shown as empty.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Bigger problem are the links, since we have 2 attributes showing links to external documents (with clickable text "More info").&lt;/P&gt;&lt;P&gt;Now, no matter if there is a link in the table for that feature or not, both link attributes are shown, both with clickable text, from which only one is right or none (as some don´t have any external links).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I would like a solution where I can write in the code, if attribute is without value not to be shown, those ones with values to be shown. I´ve tried with different combinations of IF ELSE, but didn´t work, I just lack experience.&lt;/P&gt;&lt;P&gt;Here´s the part of the code with attributes in JS:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;var other = new InfoTemplate("",
&amp;nbsp; // OTHER ATTRIBUTES
&amp;nbsp; "&amp;nbsp;&amp;lt;b&amp;gt;Name&amp;lt;/b&amp;gt;:&amp;lt;br&amp;gt;&amp;nbsp;${Name}" + "&amp;lt;br&amp;gt;" + "&amp;lt;br&amp;gt;" +
&amp;nbsp; "&amp;amp;nbsp&amp;lt;b&amp;gt;Map layer&amp;lt;/b&amp;gt;:&amp;lt;br&amp;gt;&amp;nbsp;${Map_layer}"+ "&amp;lt;br&amp;gt;" + "&amp;lt;br&amp;gt;" +
&amp;nbsp; "&amp;amp;nbsp&amp;lt;b&amp;gt;Classification&amp;lt;/b&amp;gt;:&amp;lt;br&amp;gt;&amp;nbsp;${Classification}"+ "&amp;lt;br&amp;gt;" + "&amp;lt;br&amp;gt;" +
&amp;nbsp; "&amp;amp;nbsp&amp;lt;b&amp;gt;Assesment&amp;lt;/b&amp;gt;:&amp;lt;br&amp;gt;&amp;nbsp;${Assesment}" + "&amp;lt;br&amp;gt;" + "&amp;lt;br&amp;gt;" +
&amp;nbsp; "&amp;nbsp;&amp;lt;b&amp;gt;Justification&amp;lt;/b&amp;gt;:&amp;lt;br&amp;gt;&amp;nbsp;${Justification}" + "&amp;lt;br&amp;gt;" + "&amp;lt;br&amp;gt;" +
&amp;nbsp; "&amp;nbsp;&amp;lt;b&amp;gt;Link&amp;lt;/b&amp;gt;:&amp;lt;br&amp;gt;&amp;nbsp;&amp;lt;a href=${Link} target=_blank&amp;gt;More info&amp;lt;/a&amp;gt;" + "&amp;lt;br&amp;gt;" + "&amp;lt;br&amp;gt;" +
&amp;nbsp; "&amp;nbsp;&amp;lt;b&amp;gt;Link2&amp;lt;/b&amp;gt;:&amp;lt;br&amp;gt;&amp;nbsp;&amp;lt;a href=${Link2} target=_blank&amp;gt;More info&amp;lt;/a&amp;gt;" + "&amp;lt;br&amp;gt;" + "&amp;lt;br&amp;gt;" +
&amp;nbsp; "&amp;amp;nbsp&amp;lt;b&amp;gt;Contact person&amp;lt;/b&amp;gt;:&amp;lt;br&amp;gt;&amp;nbsp;${Contact_person}"

&amp;nbsp;&amp;nbsp; );&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Help is much appreciated! Thanks!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 11 Dec 2021 21:34:47 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/how-to-make-attributes-without-values-not-to-be/m-p/490164#M45550</guid>
      <dc:creator>NedimNasic_Kjellgren</dc:creator>
      <dc:date>2021-12-11T21:34:47Z</dc:date>
    </item>
    <item>
      <title>Re: How to make attributes without values not to be shown?</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/how-to-make-attributes-without-values-not-to-be/m-p/490165#M45551</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Nedim,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I think you may get attribute values using &lt;STRONG&gt;IdentifyTask. &lt;/STRONG&gt;When you execute the IdentifyTask, you will get results if there is any feature on map . Then you can check your attribute values are empty or not.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;For example,&lt;/P&gt;&lt;P&gt;var feature = result.feature;&lt;/P&gt;&lt;P&gt;if(feature.attributes["Link"] === Null);&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;See this sample &lt;A href="https://developers.arcgis.com/javascript/jssamples/find_popup.html" title="https://developers.arcgis.com/javascript/jssamples/find_popup.html"&gt;Display identify results in popup | ArcGIS API for JavaScript&lt;/A&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 20 Jan 2016 10:38:02 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/how-to-make-attributes-without-values-not-to-be/m-p/490165#M45551</guid>
      <dc:creator>KousikM</dc:creator>
      <dc:date>2016-01-20T10:38:02Z</dc:date>
    </item>
    <item>
      <title>Re: How to make attributes without values not to be shown?</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/how-to-make-attributes-without-values-not-to-be/m-p/490166#M45552</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Nedim,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; I would look into using the infoTemplates &lt;A href="https://developers.arcgis.com/javascript/jsapi/infotemplate-amd.html#setcontent"&gt;setContent&lt;/A&gt;​method then as you can manipulate the data and define what is to be shown in the pop-up before it is shown. There are sveral examples of using this method if you search for setContent.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 20 Jan 2016 13:10:22 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/how-to-make-attributes-without-values-not-to-be/m-p/490166#M45552</guid>
      <dc:creator>RobertScheitlin__GISP</dc:creator>
      <dc:date>2016-01-20T13:10:22Z</dc:date>
    </item>
    <item>
      <title>Re: How to make attributes without values not to be shown?</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/how-to-make-attributes-without-values-not-to-be/m-p/490167#M45553</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I´ll study it a bit closer one of these days and see how it´ll go for me.&lt;/P&gt;&lt;P&gt;Thanks to both!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 21 Jan 2016 11:39:18 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/how-to-make-attributes-without-values-not-to-be/m-p/490167#M45553</guid>
      <dc:creator>NedimNasic_Kjellgren</dc:creator>
      <dc:date>2016-01-21T11:39:18Z</dc:date>
    </item>
  </channel>
</rss>

