<?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: adding the fields from a feature set to a new layer in ArcGIS JavaScript Maps SDK Questions</title>
    <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/adding-the-fields-from-a-feature-set-to-a-new/m-p/204571#M18962</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi there,&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Please do not use applyEdits. FeatureLayer.applyEdits() method is used to created, update or delete features in a FeatureLayer. You are physically changing features in your service. You can, query your features as you are doing, once the query results are returned you can simply zoom to the query result features by calling &lt;A href="https://developers.arcgis.com/javascript/latest/api-reference/esri-views-MapView.html#goTo"&gt;MapView.goTo&lt;/A&gt; passing the array of features, then display the popupTemplate by calling&amp;nbsp;&lt;A href="https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Popup.html#open"&gt;popup.open.&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I also updated your app to use&lt;A href="https://developers.arcgis.com/javascript/latest/api-reference/esri-views-layers-FeatureLayerView.html#queryFeatures"&gt; FeatureLayerView.queryFeatures&lt;/A&gt; method as this method queries the features on the client side without having to make a network trip to the server like FeatureLayer.queryFeatures does. However, this method will&amp;nbsp;&amp;nbsp;query features that are available on the client at the time of query. If you need to make sure that you are querying all features available in the service then use FeatureLayer.queryFeatures.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Here is the &lt;A href="https://codepen.io/U_B_U/pen/OJPVvXZ?editors=1000"&gt;updated test app&lt;/A&gt;.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Hope this helps,&lt;/P&gt;&lt;P&gt;-Undral&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 05 Dec 2019 17:39:24 GMT</pubDate>
    <dc:creator>UndralBatsukh</dc:creator>
    <dc:date>2019-12-05T17:39:24Z</dc:date>
    <item>
      <title>adding the fields from a feature set to a new layer</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/adding-the-fields-from-a-feature-set-to-a-new/m-p/204568#M18959</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P style="text-align: left;"&gt;this is the sample I am working on&amp;nbsp;&lt;A class="link-titled" href="https://codepen.io/segev-salman/pen/xxxjpaX?editors=1000" title="https://codepen.io/segev-salman/pen/xxxjpaX?editors=1000"&gt;https://codepen.io/segev-salman/pen/xxxjpaX?editors=1000&lt;/A&gt;&amp;nbsp;&lt;/P&gt;&lt;P style="text-align: left;"&gt;&lt;/P&gt;&lt;P style="text-align: left;"&gt;this demo finds a feature by input id creates a new layer with only that feature and zooms in on it.&amp;nbsp;&lt;/P&gt;&lt;P style="text-align: left;"&gt;&lt;/P&gt;&lt;P style="text-align: left;"&gt;i want to add a popup with the features details(i want them all but I am using 2 for the demo). when creating the feature&amp;nbsp; set&amp;nbsp;I am using outFields = ["*"] &amp;nbsp;to get all the fields for use in the popup but I am failing on the part of inserting them into the layer and maybe to the popup &lt;SPAN&gt;graphic&lt;/SPAN&gt;.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 20 Nov 2019 21:52:53 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/adding-the-fields-from-a-feature-set-to-a-new/m-p/204568#M18959</guid>
      <dc:creator>deleted-user-wcpelUUf_XXx</dc:creator>
      <dc:date>2019-11-20T21:52:53Z</dc:date>
    </item>
    <item>
      <title>Re: adding the fields from a feature set to a new layer</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/adding-the-fields-from-a-feature-set-to-a-new/m-p/204569#M18960</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi there,&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have looked at your codepen. I updated a few things in your codepen to make your current workflow work. Mainly, you should not set outFields instead you have to set the fields property for the new FeatureLayer. See below:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;&lt;CODE&gt;layer &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; &lt;SPAN class="keyword token"&gt;new&lt;/SPAN&gt; &lt;SPAN class="token class-name"&gt;FeatureLayer&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;{&lt;/SPAN&gt;
 objectIdField&lt;SPAN class="punctuation token"&gt;:&lt;/SPAN&gt; &lt;SPAN class="string token"&gt;"OBJECTID"&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; 
 source&lt;SPAN class="punctuation token"&gt;:&lt;/SPAN&gt; featureSet&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;features&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt;
 fields&lt;SPAN class="punctuation token"&gt;:&lt;/SPAN&gt; featureSet&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;fields&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt;
 popupTemplate&lt;SPAN class="punctuation token"&gt;:&lt;/SPAN&gt; &lt;SPAN class="punctuation token"&gt;{&lt;/SPAN&gt;
   content&lt;SPAN class="punctuation token"&gt;:&lt;/SPAN&gt; &lt;SPAN class="string token"&gt;"{name1} in {city} has {OBJECTID}"&lt;/SPAN&gt;
 &lt;SPAN class="punctuation token"&gt;}&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt;
 renderer&lt;SPAN class="punctuation token"&gt;:&lt;/SPAN&gt; newRend
&lt;SPAN class="punctuation token"&gt;}&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;;&lt;/SPAN&gt;&lt;SPAN class="line-numbers-rows"&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Here is the updated &lt;A href="https://codepen.io/U_B_U/pen/oNNVRYV?editors=1000" rel="nofollow noopener noreferrer" target="_blank"&gt;codepen&lt;/A&gt;.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;However, I am not sure why you are creating a new FeatureLayer every time users enter a new input. This can lead to sluggish and slow performing app. You should be able to set all of what you are setting on a new featurelayer on your pointservice featurelayer. When user enters an input, call queryFeatures, zoom to that feature all without have to create a new featurelayer everytime!&amp;nbsp;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 11 Dec 2021 10:08:32 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/adding-the-fields-from-a-feature-set-to-a-new/m-p/204569#M18960</guid>
      <dc:creator>UndralBatsukh</dc:creator>
      <dc:date>2021-12-11T10:08:32Z</dc:date>
    </item>
    <item>
      <title>Re: adding the fields from a feature set to a new layer</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/adding-the-fields-from-a-feature-set-to-a-new/m-p/204570#M18961</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P style="text-align: left;"&gt;thank you! the new layer was a bad call on my parts o Im trying to call&amp;nbsp;&lt;SPAN style="background-color: #ffffff;"&gt;queryFeatures and zoom on the pointservice without creating a new featurelayer.&lt;BR /&gt;I am not entirely sure how to do it, I transfered the popup to the pointservice featurelayer, and now trying to applyedits to .&lt;/SPAN&gt;&lt;SPAN style="background-color: #ffffff;"&gt;the layer&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="text-align: left;"&gt;&lt;SPAN style="background-color: #ffffff;"&gt;heres the edited pen if you can take a look :&amp;nbsp;&lt;A class="link-titled" href="https://codepen.io/segev-salman/pen/povoyoQ?editors=1010" title="https://codepen.io/segev-salman/pen/povoyoQ?editors=1010"&gt;https://codepen.io/segev-salman/pen/povoyoQ?editors=1010&lt;/A&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="text-align: left;"&gt;&lt;SPAN style="background-color: #ffffff;"&gt;thank you again!&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 02 Dec 2019 08:44:17 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/adding-the-fields-from-a-feature-set-to-a-new/m-p/204570#M18961</guid>
      <dc:creator>deleted-user-wcpelUUf_XXx</dc:creator>
      <dc:date>2019-12-02T08:44:17Z</dc:date>
    </item>
    <item>
      <title>Re: adding the fields from a feature set to a new layer</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/adding-the-fields-from-a-feature-set-to-a-new/m-p/204571#M18962</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi there,&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Please do not use applyEdits. FeatureLayer.applyEdits() method is used to created, update or delete features in a FeatureLayer. You are physically changing features in your service. You can, query your features as you are doing, once the query results are returned you can simply zoom to the query result features by calling &lt;A href="https://developers.arcgis.com/javascript/latest/api-reference/esri-views-MapView.html#goTo"&gt;MapView.goTo&lt;/A&gt; passing the array of features, then display the popupTemplate by calling&amp;nbsp;&lt;A href="https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Popup.html#open"&gt;popup.open.&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I also updated your app to use&lt;A href="https://developers.arcgis.com/javascript/latest/api-reference/esri-views-layers-FeatureLayerView.html#queryFeatures"&gt; FeatureLayerView.queryFeatures&lt;/A&gt; method as this method queries the features on the client side without having to make a network trip to the server like FeatureLayer.queryFeatures does. However, this method will&amp;nbsp;&amp;nbsp;query features that are available on the client at the time of query. If you need to make sure that you are querying all features available in the service then use FeatureLayer.queryFeatures.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Here is the &lt;A href="https://codepen.io/U_B_U/pen/OJPVvXZ?editors=1000"&gt;updated test app&lt;/A&gt;.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Hope this helps,&lt;/P&gt;&lt;P&gt;-Undral&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 05 Dec 2019 17:39:24 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/adding-the-fields-from-a-feature-set-to-a-new/m-p/204571#M18962</guid>
      <dc:creator>UndralBatsukh</dc:creator>
      <dc:date>2019-12-05T17:39:24Z</dc:date>
    </item>
  </channel>
</rss>

