<?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 Expression in ArcGIS Survey123 Questions</title>
    <link>https://community.esri.com/t5/arcgis-survey123-questions/data-expression/m-p/1222973#M45396</link>
    <description>&lt;P&gt;It usually means you are getting a null value in code then trying to access properties of it.&amp;nbsp; I have found that often the map must have at least 1 feature in it or arcade flips out and you cannot save it.&lt;/P&gt;&lt;P&gt;I think you forgot to post the actual code.&amp;nbsp; I have been doing a lot of data expressions so post the code and maybe I can see it.&lt;/P&gt;</description>
    <pubDate>Tue, 18 Oct 2022 18:25:19 GMT</pubDate>
    <dc:creator>DougBrowning</dc:creator>
    <dc:date>2022-10-18T18:25:19Z</dc:date>
    <item>
      <title>Data Expression</title>
      <link>https://community.esri.com/t5/arcgis-survey123-questions/data-expression/m-p/1222912#M45391</link>
      <description>&lt;P data-unlink="true"&gt;Hello! I am attempting to use data expressions as described in &lt;A href="https://www.esri.com/arcgis-blog/products/ops-dashboard/announcements/introducing-data-expressions-in-arcgis-dashboards/" target="_blank" rel="noopener"&gt;this&lt;/A&gt; page, however I am getting an error:&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Hammers21_0-1666111654610.png" style="width: 400px;"&gt;&lt;img src="https://community.esri.com/t5/image/serverpage/image-id/53847i5AAFB7C198B0DE08/image-size/medium?v=v2&amp;amp;px=400" role="button" title="Hammers21_0-1666111654610.png" alt="Hammers21_0-1666111654610.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I'm trying to use the first example, and have copy/pasted the text and replaced the survey URL and item ID. Can anyone help me figure out what this error means and why I am getting it?&lt;/P&gt;&lt;P&gt;Thank you!&lt;/P&gt;</description>
      <pubDate>Tue, 18 Oct 2022 16:49:16 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-survey123-questions/data-expression/m-p/1222912#M45391</guid>
      <dc:creator>Hammers211</dc:creator>
      <dc:date>2022-10-18T16:49:16Z</dc:date>
    </item>
    <item>
      <title>Re: Data Expression</title>
      <link>https://community.esri.com/t5/arcgis-survey123-questions/data-expression/m-p/1222973#M45396</link>
      <description>&lt;P&gt;It usually means you are getting a null value in code then trying to access properties of it.&amp;nbsp; I have found that often the map must have at least 1 feature in it or arcade flips out and you cannot save it.&lt;/P&gt;&lt;P&gt;I think you forgot to post the actual code.&amp;nbsp; I have been doing a lot of data expressions so post the code and maybe I can see it.&lt;/P&gt;</description>
      <pubDate>Tue, 18 Oct 2022 18:25:19 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-survey123-questions/data-expression/m-p/1222973#M45396</guid>
      <dc:creator>DougBrowning</dc:creator>
      <dc:date>2022-10-18T18:25:19Z</dc:date>
    </item>
    <item>
      <title>Re: Data Expression</title>
      <link>https://community.esri.com/t5/arcgis-survey123-questions/data-expression/m-p/1222984#M45397</link>
      <description>&lt;P&gt;For reference, this is the expression:&lt;/P&gt;&lt;LI-CODE lang="javascript"&gt;// Reference layer using the FeatureSetByPortalItem() function. 
var fs = FeatureSetByPortalItem(Portal('https://www.arcgis.com'), 'd10b9e8dbd7f4cccbd0a938a06c586e9' , 0, ['Report_road_condition'], false);

// Empty dictionary to capture each hazard reported as separate rows. 
var choicesDict = {'fields': [{ 'name': 'split_choices', 'type': 'esriFieldTypeString'}], 
                    'geometryType': '', 'features': []}; 

var index = 0; 

// Split comma separated hazard types and store in dictionary.  
for (var feature in fs) { 
    var split_array  =  Split(feature["Report_road_condition"], ',') 
    var count_arr = Count(split_array) 
    for(var i = 0; i &amp;lt; count_arr; i++ ){ 
        choicesDict.features[index++] = { 
            'attributes': { 'split_choices': Trim(split_array[i]),  
            }} 
}} 

// Convert dictionary to featureSet. 
var fs_dict = FeatureSet(Text(choicesDict)); 

// Return featureset after grouping by hazard types. 
return GroupBy(fs_dict, ['split_choices'], 
       [{ name: 'split_count', expression: 'split_choices', statistic: 'COUNT' }]); &lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;At a quick glance, I don't see where this error could come from. Anything I can think of would either work or give a different error. Check these points anyway:&lt;/P&gt;&lt;UL&gt;&lt;LI&gt;Make sure your portal url and item and sublayer id are correct&lt;/LI&gt;&lt;LI&gt;Make sure you query the correct field (Report_road_condition in the example)&lt;/LI&gt;&lt;LI&gt;Make sure that this field is a text field&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;If these don't work, we need to know more to help:&lt;/P&gt;&lt;UL&gt;&lt;LI&gt;Test the original expression from the example in your Dashboard, does that work?&lt;/LI&gt;&lt;LI&gt;Post your expression&lt;/LI&gt;&lt;LI&gt;If possible, share your data publicly&lt;/LI&gt;&lt;/UL&gt;</description>
      <pubDate>Tue, 18 Oct 2022 18:31:52 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-survey123-questions/data-expression/m-p/1222984#M45397</guid>
      <dc:creator>JohannesLindner</dc:creator>
      <dc:date>2022-10-18T18:31:52Z</dc:date>
    </item>
    <item>
      <title>Re: Data Expression</title>
      <link>https://community.esri.com/t5/arcgis-survey123-questions/data-expression/m-p/1223018#M45401</link>
      <description>&lt;P&gt;// Reference layer using the FeatureSetByPortalItem() function.&lt;BR /&gt;var fs = FeatureSetByPortalItem(Portal('&lt;A href="https://www.arcgis.com" target="_blank"&gt;https://www.arcgis.com&lt;/A&gt;'), '9cf4c3f33ac44231a36030dde78afb9b' , 0, ['list_name'], false);&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I'm just doing it bit by bit at the moment, so above is all there is so far. FYI, I actually named it list_name.&lt;/P&gt;</description>
      <pubDate>Tue, 18 Oct 2022 19:32:36 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-survey123-questions/data-expression/m-p/1223018#M45401</guid>
      <dc:creator>Hammers211</dc:creator>
      <dc:date>2022-10-18T19:32:36Z</dc:date>
    </item>
    <item>
      <title>Re: Data Expression</title>
      <link>https://community.esri.com/t5/arcgis-survey123-questions/data-expression/m-p/1223020#M45402</link>
      <description>&lt;P&gt;I looked up the service id and that is for the form.&amp;nbsp; You need to use the ID of the Feature Service where the data gets put.&amp;nbsp; 123 always makes both.&lt;/P&gt;</description>
      <pubDate>Tue, 18 Oct 2022 19:40:23 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-survey123-questions/data-expression/m-p/1223020#M45402</guid>
      <dc:creator>DougBrowning</dc:creator>
      <dc:date>2022-10-18T19:40:23Z</dc:date>
    </item>
    <item>
      <title>Re: Data Expression</title>
      <link>https://community.esri.com/t5/arcgis-survey123-questions/data-expression/m-p/1223398#M45422</link>
      <description>&lt;P&gt;Thank you for the suggestions, I will try them ASAP. Where do I find the item/sublayer IDs? Also, by "Make sure that this field is a text field" do you mean that the question type should be text? I need to use select multiple for this particular task. Hopefully I misunderstood.&lt;/P&gt;</description>
      <pubDate>Wed, 19 Oct 2022 16:00:08 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-survey123-questions/data-expression/m-p/1223398#M45422</guid>
      <dc:creator>Hammers211</dc:creator>
      <dc:date>2022-10-19T16:00:08Z</dc:date>
    </item>
    <item>
      <title>Re: Data Expression</title>
      <link>https://community.esri.com/t5/arcgis-survey123-questions/data-expression/m-p/1223403#M45423</link>
      <description>&lt;P&gt;Where do I find the ID for the Feature Service?&lt;/P&gt;</description>
      <pubDate>Wed, 19 Oct 2022 16:09:14 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-survey123-questions/data-expression/m-p/1223403#M45423</guid>
      <dc:creator>Hammers211</dc:creator>
      <dc:date>2022-10-19T16:09:14Z</dc:date>
    </item>
    <item>
      <title>Re: Data Expression</title>
      <link>https://community.esri.com/t5/arcgis-survey123-questions/data-expression/m-p/1223545#M45435</link>
      <description>&lt;P&gt;Look in AGOL in the same folder as the form and you will see it.&amp;nbsp; Open the page then its right at the top in the URL.&lt;/P&gt;</description>
      <pubDate>Wed, 19 Oct 2022 19:51:45 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-survey123-questions/data-expression/m-p/1223545#M45435</guid>
      <dc:creator>DougBrowning</dc:creator>
      <dc:date>2022-10-19T19:51:45Z</dc:date>
    </item>
  </channel>
</rss>

