<?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 Re: Use Category Selector as a Yes or No? in ArcGIS Dashboards Questions</title>
    <link>https://community.esri.com/t5/arcgis-dashboards-questions/use-category-selector-as-a-yes-or-no/m-p/1195036#M6594</link>
    <description>&lt;P&gt;If you used a Data Expression, you could create a filter based on whether the URL was null or not, but then you might have trouble connecting that selector back to the original data, unless that Data Expression&amp;nbsp;&lt;EM&gt;also&amp;nbsp;&lt;/EM&gt;was referenced by most of your other non-map widgets.&lt;/P&gt;&lt;LI-CODE lang="javascript"&gt;var portal = Portal('your portal url')

var fields = [
    'array',
    'of',
    'field',
    'names',
    'you',
    'need'
]

// make sure the objectid is one of the fields you include!

var fs = FeatureSetByPortalItem(
    portal,
    'itemid of service',
    0, // or whatever index the layer is
    fields,
    False
)

return GroupBy(
    fs,
    fields,
    {
        name: 'has_pr',
        expression: 'CASE WHEN press_release IS NULL THEN 0 ELSE 1 END',
        statistic: 'SUM'
    }
)&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;In short, this would basically give you back the same set of features you put into it, with all the same fields, but with a new field tacked on, called&amp;nbsp;&lt;STRONG&gt;has_pr&lt;/STRONG&gt;. This field will be a 0 when the press release URL field is null, and 1 when it has a value present.&lt;/P&gt;&lt;P&gt;You'd be able to configure any non-map widgets to look at this Data Expression to show things like a list, statistical indicators, and the like, and interactions with other widgets like a list or chart could be used to filter features in the map by linking their objectid fields.&lt;/P&gt;</description>
    <pubDate>Fri, 22 Jul 2022 18:11:02 GMT</pubDate>
    <dc:creator>jcarlson</dc:creator>
    <dc:date>2022-07-22T18:11:02Z</dc:date>
    <item>
      <title>Use Category Selector as a Yes or No?</title>
      <link>https://community.esri.com/t5/arcgis-dashboards-questions/use-category-selector-as-a-yes-or-no/m-p/1194974#M6593</link>
      <description>&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;I created a dashboard that shows crime data to our citizens. In the feature, I added a Press Release column that I add a URL to the specific press release related to that crime.&lt;/P&gt;&lt;P&gt;I want to create a tool that would allow the user to just see crime incidents that have a press release associated with them.&lt;/P&gt;&lt;P&gt;Is there a way to use the category selector to show only incidents that have a URL in the press_release column of the feature? I'm thinking I would need to use the Defined values option and set up some value that would select the rows that are not null and then filter.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks for the help!&lt;/P&gt;</description>
      <pubDate>Fri, 22 Jul 2022 16:09:22 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-dashboards-questions/use-category-selector-as-a-yes-or-no/m-p/1194974#M6593</guid>
      <dc:creator>RobertStanionis</dc:creator>
      <dc:date>2022-07-22T16:09:22Z</dc:date>
    </item>
    <item>
      <title>Re: Use Category Selector as a Yes or No?</title>
      <link>https://community.esri.com/t5/arcgis-dashboards-questions/use-category-selector-as-a-yes-or-no/m-p/1195036#M6594</link>
      <description>&lt;P&gt;If you used a Data Expression, you could create a filter based on whether the URL was null or not, but then you might have trouble connecting that selector back to the original data, unless that Data Expression&amp;nbsp;&lt;EM&gt;also&amp;nbsp;&lt;/EM&gt;was referenced by most of your other non-map widgets.&lt;/P&gt;&lt;LI-CODE lang="javascript"&gt;var portal = Portal('your portal url')

var fields = [
    'array',
    'of',
    'field',
    'names',
    'you',
    'need'
]

// make sure the objectid is one of the fields you include!

var fs = FeatureSetByPortalItem(
    portal,
    'itemid of service',
    0, // or whatever index the layer is
    fields,
    False
)

return GroupBy(
    fs,
    fields,
    {
        name: 'has_pr',
        expression: 'CASE WHEN press_release IS NULL THEN 0 ELSE 1 END',
        statistic: 'SUM'
    }
)&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;In short, this would basically give you back the same set of features you put into it, with all the same fields, but with a new field tacked on, called&amp;nbsp;&lt;STRONG&gt;has_pr&lt;/STRONG&gt;. This field will be a 0 when the press release URL field is null, and 1 when it has a value present.&lt;/P&gt;&lt;P&gt;You'd be able to configure any non-map widgets to look at this Data Expression to show things like a list, statistical indicators, and the like, and interactions with other widgets like a list or chart could be used to filter features in the map by linking their objectid fields.&lt;/P&gt;</description>
      <pubDate>Fri, 22 Jul 2022 18:11:02 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-dashboards-questions/use-category-selector-as-a-yes-or-no/m-p/1195036#M6594</guid>
      <dc:creator>jcarlson</dc:creator>
      <dc:date>2022-07-22T18:11:02Z</dc:date>
    </item>
    <item>
      <title>Re: Use Category Selector as a Yes or No?</title>
      <link>https://community.esri.com/t5/arcgis-dashboards-questions/use-category-selector-as-a-yes-or-no/m-p/1195057#M6595</link>
      <description>&lt;P&gt;Thank you. I will give this a try.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 22 Jul 2022 18:41:25 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-dashboards-questions/use-category-selector-as-a-yes-or-no/m-p/1195057#M6595</guid>
      <dc:creator>RobertStanionis</dc:creator>
      <dc:date>2022-07-22T18:41:25Z</dc:date>
    </item>
  </channel>
</rss>

