<?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 Change widget configuration at runtime for a custom Experience Builder widget in ArcGIS Experience Builder Questions</title>
    <link>https://community.esri.com/t5/arcgis-experience-builder-questions/change-widget-configuration-at-runtime-for-a/m-p/1537626#M14807</link>
    <description>&lt;P&gt;I have implemented the AppConfigProcessorExtension to update my widget configuration at runtime. Following is a snippet of the code that I am using. The updates I am trying to apply using setIn method are not being reflected when I output the newAppConfig in the console log for my current widget.&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;What is the correct way to update widget configuration using this extension point?&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;LI-CODE lang="javascript"&gt;async process (appConfig: AppConfig) : Promise&amp;lt;AppConfig&amp;gt; {
   
    // Do not replace when run in builder.
    if (window.jimuConfig.isInBuilder) {
      return Promise.resolve(appConfig);
    }

    // Clone the current app config to make it immutable
    let newAppConfig = Immutable(appConfig);

    // Find the widget in the app configuration
    const widgetConfig = newAppConfig.widgets[this.widgetId];

    //doing stuff to set searchwidgetconfiguration and usedatasources
    ///
   
    if (widgetConfig) {
      const updatedWidgetConfig = widgetConfig
        .setIn(['config', 'datasourceConfig'], this.searchWidgetConfig)
        .setIn(['useDataSources'], this.useDataSources);
      console.log(updatedWidgetConfig, "updatedWidgetConfig");
      newAppConfig = newAppConfig.setIn(['widgets', this.widgetId], updatedWidgetConfig);
    }
   
    return Promise.resolve(newAppConfig.asMutable({ deep: true }));

  }&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Thu, 12 Sep 2024 06:46:54 GMT</pubDate>
    <dc:creator>shoaibmomincontractlandstaffco</dc:creator>
    <dc:date>2024-09-12T06:46:54Z</dc:date>
    <item>
      <title>Change widget configuration at runtime for a custom Experience Builder widget</title>
      <link>https://community.esri.com/t5/arcgis-experience-builder-questions/change-widget-configuration-at-runtime-for-a/m-p/1537626#M14807</link>
      <description>&lt;P&gt;I have implemented the AppConfigProcessorExtension to update my widget configuration at runtime. Following is a snippet of the code that I am using. The updates I am trying to apply using setIn method are not being reflected when I output the newAppConfig in the console log for my current widget.&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;What is the correct way to update widget configuration using this extension point?&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;LI-CODE lang="javascript"&gt;async process (appConfig: AppConfig) : Promise&amp;lt;AppConfig&amp;gt; {
   
    // Do not replace when run in builder.
    if (window.jimuConfig.isInBuilder) {
      return Promise.resolve(appConfig);
    }

    // Clone the current app config to make it immutable
    let newAppConfig = Immutable(appConfig);

    // Find the widget in the app configuration
    const widgetConfig = newAppConfig.widgets[this.widgetId];

    //doing stuff to set searchwidgetconfiguration and usedatasources
    ///
   
    if (widgetConfig) {
      const updatedWidgetConfig = widgetConfig
        .setIn(['config', 'datasourceConfig'], this.searchWidgetConfig)
        .setIn(['useDataSources'], this.useDataSources);
      console.log(updatedWidgetConfig, "updatedWidgetConfig");
      newAppConfig = newAppConfig.setIn(['widgets', this.widgetId], updatedWidgetConfig);
    }
   
    return Promise.resolve(newAppConfig.asMutable({ deep: true }));

  }&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 12 Sep 2024 06:46:54 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-experience-builder-questions/change-widget-configuration-at-runtime-for-a/m-p/1537626#M14807</guid>
      <dc:creator>shoaibmomincontractlandstaffco</dc:creator>
      <dc:date>2024-09-12T06:46:54Z</dc:date>
    </item>
    <item>
      <title>Re: Change widget configuration at runtime for a custom Experience Builder widget</title>
      <link>https://community.esri.com/t5/arcgis-experience-builder-questions/change-widget-configuration-at-runtime-for-a/m-p/1538132#M14839</link>
      <description>&lt;P&gt;The appConfig in the process() function is mutable, so you can just update it directly, like this widgetConfig.abc=123.&lt;/P&gt;</description>
      <pubDate>Fri, 13 Sep 2024 05:34:17 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-experience-builder-questions/change-widget-configuration-at-runtime-for-a/m-p/1538132#M14839</guid>
      <dc:creator>Junshan_Liu</dc:creator>
      <dc:date>2024-09-13T05:34:17Z</dc:date>
    </item>
  </channel>
</rss>

