<?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 data expression: copy a single value from a feature set to all rows of a new one in ArcGIS Dashboards Questions</title>
    <link>https://community.esri.com/t5/arcgis-dashboards-questions/arcade-data-expression-copy-a-single-value-from-a/m-p/1100269#M5120</link>
    <description>&lt;P&gt;looks fine (and very nicely formatted).&amp;nbsp; I'm wondering if it's as simple as FFG_Name being an alias? Also what's the original format of FFG_Name? What does it look like?&lt;BR /&gt;can you test it with&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="c"&gt;return att&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Tue, 21 Sep 2021 13:32:18 GMT</pubDate>
    <dc:creator>DavidPike</dc:creator>
    <dc:date>2021-09-21T13:32:18Z</dc:date>
    <item>
      <title>Arcade data expression: copy a single value from a feature set to all rows of a new one</title>
      <link>https://community.esri.com/t5/arcgis-dashboards-questions/arcade-data-expression-copy-a-single-value-from-a/m-p/1100253#M5119</link>
      <description>&lt;P&gt;Hi there,&lt;/P&gt;&lt;P&gt;I appear to have lost my way in a seemingly easy task. I would like to copy a certain value (TestSeptember) from one feature set to a new one:&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="2021-09-21 14_36_52-Window.png" style="width: 560px;"&gt;&lt;img src="https://community.esri.com/t5/image/serverpage/image-id/23452iB22803331FCF98E2/image-dimensions/560x308?v=v2" width="560" height="308" role="button" title="2021-09-21 14_36_52-Window.png" alt="2021-09-21 14_36_52-Window.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="2021-09-21 14_38_04-Window.png" style="width: 564px;"&gt;&lt;img src="https://community.esri.com/t5/image/serverpage/image-id/23454iBC439A0ACC426624/image-dimensions/564x333?v=v2" width="564" height="333" role="button" title="2021-09-21 14_38_04-Window.png" alt="2021-09-21 14_38_04-Window.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;Edit: the FFG_Name is blank due to data privacy (contains names).&lt;/P&gt;&lt;P&gt;Anyone who could guide me through this?&lt;/P&gt;&lt;P&gt;Cheers,&lt;BR /&gt;Merlin &lt;/P&gt;&lt;P&gt;If it helps, here my code so far:&lt;/P&gt;&lt;LI-SPOILER&gt;&lt;LI-CODE lang="markdown"&gt;var p = 'xxx';
var itemID = 'xxx';
var layerID = 0;

var mCSV = FeatureSetByPortalItem(Portal(p),itemID,layerID, ['*'], false );

var cuMoSt = Text(Date(Max(mCSV,'ModuleStart')),'YYYY-MM-DD');
var cuMoEn = Text(Date(Max(mCSV,'ModuleEnd')),'YYYY-MM-DD');
var cuMoDe = Filter (mCSV, 'ModuleStart &amp;gt;= @cuMoSt AND ModuleEnd &amp;lt;= @cuMoEn');

//return cuMoDe

var p = 'xxx';
var itemID = 'xxx';
var layerID = 0;

var att = FeatureSetByPortalItem(Portal(p),itemID,layerID,['start_time','end_time','FFG_Name','FT_Name','BA_Username','FT_att_men','FT_att_women','FT_att_all'],false );

var lastM = date(year(today()),month(today())-1,01);
var thisM = date(year(today()),month(today()),01);

var attCuMoFi = Filter (att, 'start_time &amp;gt;= @cuMoSt AND start_time &amp;lt;= @cuMoEn');

var dict = {
  fields: [
    { name: 'Module_desc',      type: 'esriFieldTypeString' },
    { name: 'start_time',       type: 'esriFieldTypeString' },
    { name: 'end_time',         type: 'esriFieldTypeString' },
    { name: 'FFG_Name',         type: 'esriFieldTypeString' },
    { name: 'FT_Name',          type: 'esriFieldTypeString' },
    { name: 'BA_Username',      type: 'esriFieldTypeString' },
    { name: 'FT_att_men',       type: 'esriFieldTypeString' },
    { name: 'FT_att_women',     type: 'esriFieldTypeString' },
    { name: 'FT_att_all',       type: 'esriFieldTypeString' },
  ],
  geometryType: '',
  features: [],
};

var index = 0;
for (var feature in attCuMoFi) { 
    dict.features[index] = { 
        'attributes': { 
            'start_time': Text(feature['start_time'],'YYYY-MM-DD'),
            'end_time': Text(feature['end_time'],'YYYY-MM-DD'),
            'FFG_Name': Text(feature['FFG_Name']),
            'FT_Name': Text(feature['FT_Name']),
            'BA_Username': Decode(Text(feature['BA_Username']),
			xxx
            'missing data'),
            'FT_att_men': Number(feature['FT_att_men']),
            'FT_att_women': Number(feature['FT_att_women']),
            'FT_att_all': Number(feature['FT_att_all']),
        }} 
    index++;
} 
var fs_dict = FeatureSet(Text(dict));
return fs_dict&lt;/LI-CODE&gt;&lt;/LI-SPOILER&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 21 Sep 2021 15:39:57 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-dashboards-questions/arcade-data-expression-copy-a-single-value-from-a/m-p/1100253#M5119</guid>
      <dc:creator>Merlin</dc:creator>
      <dc:date>2021-09-21T15:39:57Z</dc:date>
    </item>
    <item>
      <title>Re: Arcade data expression: copy a single value from a feature set to all rows of a new one</title>
      <link>https://community.esri.com/t5/arcgis-dashboards-questions/arcade-data-expression-copy-a-single-value-from-a/m-p/1100269#M5120</link>
      <description>&lt;P&gt;looks fine (and very nicely formatted).&amp;nbsp; I'm wondering if it's as simple as FFG_Name being an alias? Also what's the original format of FFG_Name? What does it look like?&lt;BR /&gt;can you test it with&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="c"&gt;return att&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 21 Sep 2021 13:32:18 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-dashboards-questions/arcade-data-expression-copy-a-single-value-from-a/m-p/1100269#M5120</guid>
      <dc:creator>DavidPike</dc:creator>
      <dc:date>2021-09-21T13:32:18Z</dc:date>
    </item>
    <item>
      <title>Re: Arcade data expression: copy a single value from a feature set to all rows of a new one</title>
      <link>https://community.esri.com/t5/arcgis-dashboards-questions/arcade-data-expression-copy-a-single-value-from-a/m-p/1100351#M5122</link>
      <description>&lt;P&gt;Hi David,&lt;/P&gt;&lt;P&gt;The FFG_Name field was blank to hide the names that actually show up.&lt;/P&gt;&lt;P&gt;My goal is to copy the ModuleDescription Field containing the string 'TestSeptember' to all rows of the second fs.&lt;/P&gt;&lt;P&gt;This was ppl. misguiding in the original post. I tried to edit and clarify.&lt;/P&gt;</description>
      <pubDate>Tue, 21 Sep 2021 15:43:15 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-dashboards-questions/arcade-data-expression-copy-a-single-value-from-a/m-p/1100351#M5122</guid>
      <dc:creator>Merlin</dc:creator>
      <dc:date>2021-09-21T15:43:15Z</dc:date>
    </item>
    <item>
      <title>Re: Arcade data expression: copy a single value from a feature set to all rows of a new one</title>
      <link>https://community.esri.com/t5/arcgis-dashboards-questions/arcade-data-expression-copy-a-single-value-from-a/m-p/1100691#M5124</link>
      <description>&lt;LI-CODE lang="javascript"&gt;// before line 40
var module_desc = null
if(Count(cuMoDe) &amp;gt; 0) {
  module_desc = First(cuMoDe).ModuleDescription
}

// before line 44
'Module_desc': module_desc,&lt;/LI-CODE&gt;</description>
      <pubDate>Wed, 22 Sep 2021 08:12:36 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-dashboards-questions/arcade-data-expression-copy-a-single-value-from-a/m-p/1100691#M5124</guid>
      <dc:creator>JohannesLindner</dc:creator>
      <dc:date>2021-09-22T08:12:36Z</dc:date>
    </item>
    <item>
      <title>Re: Arcade data expression: copy a single value from a feature set to all rows of a new one</title>
      <link>https://community.esri.com/t5/arcgis-dashboards-questions/arcade-data-expression-copy-a-single-value-from-a/m-p/1100695#M5125</link>
      <description>&lt;P&gt;Excellent! Cheers Johannes.&lt;BR /&gt;&lt;BR /&gt;This was the function that did all I needed:&lt;/P&gt;&lt;LI-CODE lang="javascript"&gt;First(cuMoDe).ModuleDescription&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 22 Sep 2021 08:34:34 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-dashboards-questions/arcade-data-expression-copy-a-single-value-from-a/m-p/1100695#M5125</guid>
      <dc:creator>Merlin</dc:creator>
      <dc:date>2021-09-22T08:34:34Z</dc:date>
    </item>
  </channel>
</rss>

