<?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: Data suppression with arcade - cannot execute script in ArcGIS Dashboards Questions</title>
    <link>https://community.esri.com/t5/arcgis-dashboards-questions/data-suppression-with-arcade-cannot-execute-script/m-p/1587020#M10778</link>
    <description>&lt;P&gt;When posting a question with code, please use the "&lt;A href="https://community.esri.com/t5/python-blog/code-formatting-the-community-version/ba-p/1007633#U1007633" target="_self"&gt;Insert/Edit code sample&lt;/A&gt;" button&lt;/P&gt;&lt;P&gt;You can hide the records that don't have enough daily cases simply by using the &lt;A href="https://developers.arcgis.com/arcade/function-reference/featureset_functions/#filter" target="_self"&gt;Filter&lt;/A&gt; function.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="javascript"&gt;var fsportal = Portal("https://www.arcgis.com/");
var fs = FeatureSetByPortalItem(
  fsportal,
  "dfc071575e924d5d88cb851eab914222",
  0,
  [
    "Total_Daily_Cases",
    "Hispanic_or_Latino",
    "Not_Hispanic_or_Latino",
    "Unknown_Ethnicity",
    "Ethnicity_Not_Reported",
    "Black_or_African_American",
    "White_Race",
    "Other_Race",
    "Native_Hawaiian_or_Other_Pacific_Islander_Race",
    "Asian_Race",
    "American_Indian_or_Alaskan_Native_Race",
    "Unknown_Race",
    "Race_Not_Reported",
    "Unknown_Age_Group",
    "00_17_Age_Group",
    "18_29_Age_Group",
    "30_39_Age_Group",
    "40_49_Age_Group",
    "50_64_Age_Group",
    "65_74_Age_Group",
    "75__Age_Group",
    "Year"
  ],
  false
);

Filter(fs, "Total_Daily_Cases &amp;lt;= 5")&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Wed, 19 Feb 2025 16:28:24 GMT</pubDate>
    <dc:creator>KenBuja</dc:creator>
    <dc:date>2025-02-19T16:28:24Z</dc:date>
    <item>
      <title>Data suppression with arcade - cannot execute script</title>
      <link>https://community.esri.com/t5/arcgis-dashboards-questions/data-suppression-with-arcade-cannot-execute-script/m-p/1586993#M10777</link>
      <description>&lt;P&gt;I am attempting to create an arcade code that will censor data in a serial chart on a dashboard. I am very new to arcade and there seems to be little information on how to do this or if this is possible. From lots of research I have put together some code, but the layer is marked as "unable to execute arcade script." Any tips or critiques of what I have or where I can find examples of what I am trying to do are much appreciated!&lt;/P&gt;&lt;P&gt;My code is below:&lt;/P&gt;&lt;P&gt;var fsportal = Portal("&lt;A href="https://www.arcgis.com/" target="_blank"&gt;https://www.arcgis.com/&lt;/A&gt;");&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;var fs = FeatureSetByPortalItem(fsportal, "dfc071575e924d5d88cb851eab914222", 0, ['Total_Daily_Cases','Hispanic_or_Latino',&lt;/P&gt;&lt;P&gt;'Not_Hispanic_or_Latino', 'Unknown_Ethnicity', 'Ethnicity_Not_Reported',&lt;/P&gt;&lt;P&gt;'Black_or_African_American', 'White_Race', 'Other_Race',&lt;/P&gt;&lt;P&gt;'Native_Hawaiian_or_Other_Pacific_Islander_Race', 'Asian_Race',&lt;/P&gt;&lt;P&gt;'American_Indian_or_Alaskan_Native_Race', 'Unknown_Race',&lt;/P&gt;&lt;P&gt;'Race_Not_Reported','Unknown_Age_Group', '00_17_Age_Group',&lt;/P&gt;&lt;P&gt;'18_29_Age_Group','30_39_Age_Group','40_49_Age_Group',&lt;/P&gt;&lt;P&gt;'50_64_Age_Group','65_74_Age_Group','75__Age_Group','Year', false]);&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;if (IsEmpty(fs)) {&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp; return "No data available for this query.";&lt;/P&gt;&lt;P&gt;} else {&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp; return "Feature Set successfully retrieved.";&lt;/P&gt;&lt;P&gt;}&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;var cnsrvalue = feature(fs,'Total_Daily_Cases')&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;if (cnsrvalue &amp;lt;= 5) {&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp; return "suppressed";&lt;/P&gt;&lt;P&gt;} else {&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp; return Text(cnsrvalue); &amp;nbsp;// Return the actual value as a string&lt;/P&gt;&lt;P&gt;}&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;var CnsrDict = {&lt;/P&gt;&lt;P&gt;&amp;nbsp; fields: [&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp; {name: 'Total_Daily_Cases', type: 'esriFieldTypeInteger'},&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp; {name: 'Hispanic_or_Latino', type: 'esriFieldTypeInteger'},&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp; {name: 'Not_Hispanic_or_Latino', type: 'esriFieldTypeInteger'},&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp; {name: 'Unknown_Ethnicity', type: 'esriFieldTypeInteger'},&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp; {name: 'Ethnicity_Not_Reported', type: 'esriFieldTypeInteger'},&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp; {name: 'Black_or_African_American', type: 'esriFieldTypeInteger'},&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp; {name: 'White_Race', type: 'esriFieldTypeInteger'},&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp; {name: 'Other_Race', type: 'esriFieldTypeInteger'},&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp; {name: 'Native_Hawaiian_or_Other_Pacific_Islander_Race', type: 'esriFieldTypeInteger'},&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp; {name: 'Asian_Race', type: 'esriFieldTypeInteger'},&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp; {name: 'American_Indian_or_Alaskan_Native_Race', type: 'esriFieldTypeInteger'},&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp; {name: 'Unknown_Race', type: 'esriFieldTypeInteger'},&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp; {name: 'Race_Not_Reported', type: 'esriFieldTypeInteger'},&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp; {name: 'Unknown_Age_Group', type: 'esriFieldTypeInteger'},&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp; {name: '00_17_Age_Group', type: 'esriFieldTypeInteger'},&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp; {name: '18_29_Age_Group', type: 'esriFieldTypeInteger'},&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp; {name: '30_39_Age_Group', type: 'esriFieldTypeInteger'},&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp; {name: '40_49_Age_Group', type: 'esriFieldTypeInteger'},&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp; {name: '50_64_Age_Group', type: 'esriFieldTypeInteger'},&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp; {name: '65_74_Age_Group', type: 'esriFieldTypeInteger'},&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp; {name: '75__Age_Group', type: 'esriFieldTypeInteger'},&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp; {name: 'Year', type: 'esriFieldTypeInteger'},&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp; {name: 'cnsrvalue', type: 'esriFieldTypeString'}&lt;/P&gt;&lt;P&gt;&amp;nbsp; ]&lt;/P&gt;&lt;P&gt;};&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;var index = 0;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;return Featureset(Text(CnsrDict));&lt;/P&gt;</description>
      <pubDate>Wed, 19 Feb 2025 15:36:01 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-dashboards-questions/data-suppression-with-arcade-cannot-execute-script/m-p/1586993#M10777</guid>
      <dc:creator>MarissaEnglish</dc:creator>
      <dc:date>2025-02-19T15:36:01Z</dc:date>
    </item>
    <item>
      <title>Re: Data suppression with arcade - cannot execute script</title>
      <link>https://community.esri.com/t5/arcgis-dashboards-questions/data-suppression-with-arcade-cannot-execute-script/m-p/1587020#M10778</link>
      <description>&lt;P&gt;When posting a question with code, please use the "&lt;A href="https://community.esri.com/t5/python-blog/code-formatting-the-community-version/ba-p/1007633#U1007633" target="_self"&gt;Insert/Edit code sample&lt;/A&gt;" button&lt;/P&gt;&lt;P&gt;You can hide the records that don't have enough daily cases simply by using the &lt;A href="https://developers.arcgis.com/arcade/function-reference/featureset_functions/#filter" target="_self"&gt;Filter&lt;/A&gt; function.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="javascript"&gt;var fsportal = Portal("https://www.arcgis.com/");
var fs = FeatureSetByPortalItem(
  fsportal,
  "dfc071575e924d5d88cb851eab914222",
  0,
  [
    "Total_Daily_Cases",
    "Hispanic_or_Latino",
    "Not_Hispanic_or_Latino",
    "Unknown_Ethnicity",
    "Ethnicity_Not_Reported",
    "Black_or_African_American",
    "White_Race",
    "Other_Race",
    "Native_Hawaiian_or_Other_Pacific_Islander_Race",
    "Asian_Race",
    "American_Indian_or_Alaskan_Native_Race",
    "Unknown_Race",
    "Race_Not_Reported",
    "Unknown_Age_Group",
    "00_17_Age_Group",
    "18_29_Age_Group",
    "30_39_Age_Group",
    "40_49_Age_Group",
    "50_64_Age_Group",
    "65_74_Age_Group",
    "75__Age_Group",
    "Year"
  ],
  false
);

Filter(fs, "Total_Daily_Cases &amp;lt;= 5")&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 19 Feb 2025 16:28:24 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-dashboards-questions/data-suppression-with-arcade-cannot-execute-script/m-p/1587020#M10778</guid>
      <dc:creator>KenBuja</dc:creator>
      <dc:date>2025-02-19T16:28:24Z</dc:date>
    </item>
    <item>
      <title>Re: Data suppression with arcade - cannot execute script</title>
      <link>https://community.esri.com/t5/arcgis-dashboards-questions/data-suppression-with-arcade-cannot-execute-script/m-p/1587027#M10779</link>
      <description>&lt;P&gt;The last item in the field list for&amp;nbsp;FeatureSetByPortalItem is a boolean value, not a field name. I think you mistyped the return geometry parameter, the fixed line is:&lt;/P&gt;&lt;LI-CODE lang="python"&gt;var fs = FeatureSetByPortalItem(
  fsportal,
  "dfc071575e924d5d88cb851eab914222",
  0, [
    "Total_Daily_Cases",
    "Hispanic_or_Latino",
    "Not_Hispanic_or_Latino",
    "Unknown_Ethnicity",
    "Ethnicity_Not_Reported",
    "Black_or_African_American",
    "White_Race",
    "Other_Race",
    "Native_Hawaiian_or_Other_Pacific_Islander_Race",
    "Asian_Race",
    "American_Indian_or_Alaskan_Native_Race",
    "Unknown_Race",
    "Race_Not_Reported",
    "Unknown_Age_Group",
    "00_17_Age_Group",
    "18_29_Age_Group",
    "30_39_Age_Group",
    "40_49_Age_Group",
    "50_64_Age_Group",
    "65_74_Age_Group",
    "75__Age_Group",
    "Year"
  ],
  false
);&lt;/LI-CODE&gt;</description>
      <pubDate>Wed, 19 Feb 2025 16:26:24 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-dashboards-questions/data-suppression-with-arcade-cannot-execute-script/m-p/1587027#M10779</guid>
      <dc:creator>DavidSolari</dc:creator>
      <dc:date>2025-02-19T16:26:24Z</dc:date>
    </item>
    <item>
      <title>Re: Data suppression with arcade - cannot execute script</title>
      <link>https://community.esri.com/t5/arcgis-dashboards-questions/data-suppression-with-arcade-cannot-execute-script/m-p/1587029#M10780</link>
      <description>&lt;P&gt;Good catch! I fixed that in my reply&lt;/P&gt;</description>
      <pubDate>Wed, 19 Feb 2025 16:28:44 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-dashboards-questions/data-suppression-with-arcade-cannot-execute-script/m-p/1587029#M10780</guid>
      <dc:creator>KenBuja</dc:creator>
      <dc:date>2025-02-19T16:28:44Z</dc:date>
    </item>
    <item>
      <title>Re: Data suppression with arcade - cannot execute script</title>
      <link>https://community.esri.com/t5/arcgis-dashboards-questions/data-suppression-with-arcade-cannot-execute-script/m-p/1587033#M10781</link>
      <description>&lt;P&gt;Thank you! How can I make the data label in the serial chart "suppressed" if the value is &amp;lt;= 5?&lt;/P&gt;</description>
      <pubDate>Wed, 19 Feb 2025 16:32:43 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-dashboards-questions/data-suppression-with-arcade-cannot-execute-script/m-p/1587033#M10781</guid>
      <dc:creator>MarissaEnglish</dc:creator>
      <dc:date>2025-02-19T16:32:43Z</dc:date>
    </item>
    <item>
      <title>Re: Data suppression with arcade - cannot execute script</title>
      <link>https://community.esri.com/t5/arcgis-dashboards-questions/data-suppression-with-arcade-cannot-execute-script/m-p/1587059#M10782</link>
      <description>&lt;P&gt;I can't think of a way to include text with a numeric field to be used in a serial chart.&lt;/P&gt;&lt;P&gt;Could you use a Value Guide to hide those?&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Snag_c514d1.png" style="width: 400px;"&gt;&lt;img src="https://community.esri.com/t5/image/serverpage/image-id/125803i182A158F996E85C7/image-size/medium?v=v2&amp;amp;px=400" role="button" title="Snag_c514d1.png" alt="Snag_c514d1.png" /&gt;&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 19 Feb 2025 17:15:39 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-dashboards-questions/data-suppression-with-arcade-cannot-execute-script/m-p/1587059#M10782</guid>
      <dc:creator>KenBuja</dc:creator>
      <dc:date>2025-02-19T17:15:39Z</dc:date>
    </item>
    <item>
      <title>Re: Data suppression with arcade - cannot execute script</title>
      <link>https://community.esri.com/t5/arcgis-dashboards-questions/data-suppression-with-arcade-cannot-execute-script/m-p/1587217#M10783</link>
      <description>&lt;P&gt;Another way you can do is to change all the values for the records you want suppressed to -1 (or another value) . You'd have to put a note in the chart saying what that value means. Here's an example, using a sample Esri dataset. This show the value that's being checked, but not the other values for each record. If you don't want to show that, remove lines 19-23 and uncomment line 24.&lt;/P&gt;&lt;LI-CODE lang="javascript"&gt;var fields = ["AVGHHSZ_CY", "EDUC01_CY", "EDUC02_CY"];

// Returns the first feature in the layer
var fs = Top(
  FeatureSetByPortalItem(
    Portal("https://www.arcgis.com"),
    "7b1fb95ab77f40bf8aa09c8b59045449",
    0,
    fields,
    false
  ),
  99
);
var features = [];
//return theDict
for (var f in fs) {
  var attDict = {};
  for (var a in fields) {
    if (fields[a] == "AVGHHSZ_CY") {
      attDict[fields[a]] = f[fields[a]];
    } else {
      attDict[fields[a]] = IIf(f["AVGHHSZ_CY"] &amp;gt; 3, f[fields[a]], -1);
    }
    //attDict[fields[a]] = IIf(f["AVGHHSZ_CY"] &amp;gt; 3, f[fields[a]], -1);
  }
  Push(features, { attributes: attDict });
}

return FeatureSet(
  { fields: Schema(fs).fields, geometryType: "", features: features }
);&lt;/LI-CODE&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Snag_18a8d4f.png" style="width: 400px;"&gt;&lt;img src="https://community.esri.com/t5/image/serverpage/image-id/125832iB00C8DA73E9D6EFA/image-size/medium?v=v2&amp;amp;px=400" role="button" title="Snag_18a8d4f.png" alt="Snag_18a8d4f.png" /&gt;&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 19 Feb 2025 20:51:46 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-dashboards-questions/data-suppression-with-arcade-cannot-execute-script/m-p/1587217#M10783</guid>
      <dc:creator>KenBuja</dc:creator>
      <dc:date>2025-02-19T20:51:46Z</dc:date>
    </item>
  </channel>
</rss>

