<?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: How to set multiple items using onSettingChange in ArcGIS Experience Builder Questions</title>
    <link>https://community.esri.com/t5/arcgis-experience-builder-questions/how-to-set-multiple-items-using-onsettingchange/m-p/1578287#M17067</link>
    <description>&lt;P&gt;Have you tested this code? Did it work? I see a dangling comma in your config.set() call. And dangling commas break JSON.&lt;/P&gt;</description>
    <pubDate>Thu, 23 Jan 2025 16:40:11 GMT</pubDate>
    <dc:creator>JeffreyThompson2</dc:creator>
    <dc:date>2025-01-23T16:40:11Z</dc:date>
    <item>
      <title>How to set multiple items using onSettingChange</title>
      <link>https://community.esri.com/t5/arcgis-experience-builder-questions/how-to-set-multiple-items-using-onsettingchange/m-p/1578007#M17045</link>
      <description>&lt;P&gt;I'm attempting to set two items in the config file in my Settings widget using this code, but it's only setting the second item ('templateLayerId').&lt;/P&gt;&lt;LI-CODE lang="javascript"&gt;  function onDoneClicked(): void {
    onSettingChange({
      id: id,
      config: config.set('templateLayerName', selectedItem.title),
    });
    onSettingChange({
      id: id,
      config: 
        config.set('templateLayerId', selectedItem.id),
    });
  }&lt;/LI-CODE&gt;&lt;P&gt;What's the proper syntax for setting multiple items?&lt;/P&gt;</description>
      <pubDate>Wed, 22 Jan 2025 22:00:20 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-experience-builder-questions/how-to-set-multiple-items-using-onsettingchange/m-p/1578007#M17045</guid>
      <dc:creator>KenBuja</dc:creator>
      <dc:date>2025-01-22T22:00:20Z</dc:date>
    </item>
    <item>
      <title>Re: How to set multiple items using onSettingChange</title>
      <link>https://community.esri.com/t5/arcgis-experience-builder-questions/how-to-set-multiple-items-using-onsettingchange/m-p/1578160#M17057</link>
      <description>&lt;P&gt;I recently went through this and I found that I could not set more than one setting at a time. The setting changes needed to be separated by a user interaction. I believe what was happening was whenever a setting is changed it triggers a re-render which wipes the data from the first change before the user can click the save button in the Builder to permanently save the changes. I had five interrelated settings, so I needed to make them all change together. My solution was to bundle all of my related settings into a single JSON object in the config file, so each onSettingChange call was just changing one object. Looking at the config.json files in the Server, this appears to be how the Dev team also deals with multiple setting changes at once.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 23 Jan 2025 13:28:31 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-experience-builder-questions/how-to-set-multiple-items-using-onsettingchange/m-p/1578160#M17057</guid>
      <dc:creator>JeffreyThompson2</dc:creator>
      <dc:date>2025-01-23T13:28:31Z</dc:date>
    </item>
    <item>
      <title>Re: How to set multiple items using onSettingChange</title>
      <link>https://community.esri.com/t5/arcgis-experience-builder-questions/how-to-set-multiple-items-using-onsettingchange/m-p/1578279#M17065</link>
      <description>&lt;P&gt;Thanks &lt;a href="https://community.esri.com/t5/user/viewprofilepage/user-id/677423"&gt;@JeffreyThompson2&lt;/a&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I modified the config to create a new setting of this type&lt;/P&gt;&lt;LI-CODE lang="javascript"&gt;export interface Config {
  //other settings
  templateLayer: TemplateLayer;
}
export type TemplateLayer = {
  id: string;
  name: string;
};&lt;/LI-CODE&gt;&lt;P&gt;and used this code to update it&lt;/P&gt;&lt;LI-CODE lang="javascript"&gt;onSettingChange({
  id: id,
  config: config.set('templateLayer', {
    id: selectedItem.id,
    name: selectedItem.title,
  }),
});&lt;/LI-CODE&gt;</description>
      <pubDate>Thu, 23 Jan 2025 16:33:34 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-experience-builder-questions/how-to-set-multiple-items-using-onsettingchange/m-p/1578279#M17065</guid>
      <dc:creator>KenBuja</dc:creator>
      <dc:date>2025-01-23T16:33:34Z</dc:date>
    </item>
    <item>
      <title>Re: How to set multiple items using onSettingChange</title>
      <link>https://community.esri.com/t5/arcgis-experience-builder-questions/how-to-set-multiple-items-using-onsettingchange/m-p/1578287#M17067</link>
      <description>&lt;P&gt;Have you tested this code? Did it work? I see a dangling comma in your config.set() call. And dangling commas break JSON.&lt;/P&gt;</description>
      <pubDate>Thu, 23 Jan 2025 16:40:11 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-experience-builder-questions/how-to-set-multiple-items-using-onsettingchange/m-p/1578287#M17067</guid>
      <dc:creator>JeffreyThompson2</dc:creator>
      <dc:date>2025-01-23T16:40:11Z</dc:date>
    </item>
    <item>
      <title>Re: How to set multiple items using onSettingChange</title>
      <link>https://community.esri.com/t5/arcgis-experience-builder-questions/how-to-set-multiple-items-using-onsettingchange/m-p/1578292#M17069</link>
      <description>&lt;P&gt;Yes, this does work properly. That dangling comma is added by the VS Code Prettier and didn't have an effect on it&lt;/P&gt;</description>
      <pubDate>Thu, 23 Jan 2025 16:55:58 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-experience-builder-questions/how-to-set-multiple-items-using-onsettingchange/m-p/1578292#M17069</guid>
      <dc:creator>KenBuja</dc:creator>
      <dc:date>2025-01-23T16:55:58Z</dc:date>
    </item>
  </channel>
</rss>

