<?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: Arcade Syntax Error: Text execution error: Unknown Error. Verify test Data in ArcGIS Dashboards Questions</title>
    <link>https://community.esri.com/t5/arcgis-dashboards-questions/arcade-syntax-error-text-execution-error-unknown/m-p/1477074#M9625</link>
    <description>&lt;P&gt;It's hard to test this on your private data, but one thing I see is in line 16, you're looping through the Schema, not the FeatureSet.&lt;/P&gt;&lt;P&gt;Debugging a script can be made easier by using &lt;A href="https://developers.arcgis.com/arcade/function-reference/debugging_functions/#console" target="_self"&gt;Console&lt;/A&gt; messages at certain points to see where the script is crashing and checking in the variables you're using a returning what you're expecting.&lt;/P&gt;</description>
    <pubDate>Wed, 22 May 2024 16:31:31 GMT</pubDate>
    <dc:creator>KenBuja</dc:creator>
    <dc:date>2024-05-22T16:31:31Z</dc:date>
    <item>
      <title>Arcade Syntax Error: Text execution error: Unknown Error. Verify test Data</title>
      <link>https://community.esri.com/t5/arcgis-dashboards-questions/arcade-syntax-error-text-execution-error-unknown/m-p/1476617#M9619</link>
      <description>&lt;P&gt;I would appreciate some help with my Arcade code. It keeps on saying "Text execution error: Unknown Error. Verify test Data"&lt;BR /&gt;I am attempting to add the sums of the values in two fields in my underlying layer, and once I get those two sums, add return the feature set with the calculated value. I am not sure where the problem even is as nothing is highlighted for me to even address. I appreciate whoever helps out with this&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="javascript"&gt;var p = Portal('https://GOJ.maps.arcgis.com/');

var fs = FeatureSetByPortalItem(p, '58bc1181751d4ea980c3f6bde0eaa323', 1, ['BallotsCastC1', 'BallotsCastC2', 'BoxesCounted'], false);
var s = Schema(fs);
Push(s.fields, {'name':'BallotsTotal', 'alias': 'Ballots Total', 'type': 'esriFieldTypeDouble'})

var returnFS = {
    fields: s.fields,
    geometryType: '',
    features: []
};

var sumBallotsCastC1 = 0;
var sumBallotsCastC2 = 0;

for (var r in s) {
    sumBallotsCastC1 += r.BallotsCastC1;
    sumBallotsCastC2 += r.BallotsCastC2;
    
}

var ballotsTotal = sumBallotsCastC1 + sumBallotsCastC2;



var featureAttributes = {
    BallotsCastC1: sumBallotsCastC1,
    BallotsCastC2: sumBallotsCastC2,
    BallotsTotal: ballotsTotal
};

Push(returnFS.features, {'attributes': featureAttributes});

return FeatureSet(Text(returnFS));&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 21 May 2024 22:14:12 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-dashboards-questions/arcade-syntax-error-text-execution-error-unknown/m-p/1476617#M9619</guid>
      <dc:creator>DanielDuncan</dc:creator>
      <dc:date>2024-05-21T22:14:12Z</dc:date>
    </item>
    <item>
      <title>Re: Arcade Syntax Error: Text execution error: Unknown Error. Verify test Data</title>
      <link>https://community.esri.com/t5/arcgis-dashboards-questions/arcade-syntax-error-text-execution-error-unknown/m-p/1477074#M9625</link>
      <description>&lt;P&gt;It's hard to test this on your private data, but one thing I see is in line 16, you're looping through the Schema, not the FeatureSet.&lt;/P&gt;&lt;P&gt;Debugging a script can be made easier by using &lt;A href="https://developers.arcgis.com/arcade/function-reference/debugging_functions/#console" target="_self"&gt;Console&lt;/A&gt; messages at certain points to see where the script is crashing and checking in the variables you're using a returning what you're expecting.&lt;/P&gt;</description>
      <pubDate>Wed, 22 May 2024 16:31:31 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-dashboards-questions/arcade-syntax-error-text-execution-error-unknown/m-p/1477074#M9625</guid>
      <dc:creator>KenBuja</dc:creator>
      <dc:date>2024-05-22T16:31:31Z</dc:date>
    </item>
  </channel>
</rss>

