<?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 Use global variable for url parameter in widget config in Web AppBuilder Custom Widgets Questions</title>
    <link>https://community.esri.com/t5/web-appbuilder-custom-widgets-questions/use-global-variable-for-url-parameter-in-widget/m-p/772781#M1792</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I'm not sure I'm best articulating the question or the path I'm trying to go down here but I'm wondering about having a configurable value that can be concatenated to a url parameter in a widget config.&amp;nbsp; I have a case where a portion of&amp;nbsp;a url changes based on if the application is a development or production version.&amp;nbsp; As opposed to having&amp;nbsp;a dev and prod config for each widget that has different dev and prod urls, I'd like to just have a configurable value I can set that will be concatenated to the rest of whatever url value is in the widget config.&amp;nbsp; I was thinking, I could set a global variable when the application loads maybe something like var PrdOrDev = 'PartOfUrlThatMakesItPrdorDev' and then in my widget config change the url parameter to "${MyDeploymentVersion}/moreurl/arcgis/rest/blah/blh/blah" and then modify processUrlInWidgetConfig in utils.js to handle url.startWith('${MyDeploymentVersion}) by replacing it with window.PrdOrDev.&amp;nbsp; For anyone that's followed me this far, is this a proper track or is it completely off the rails?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 06 Dec 2018 15:56:00 GMT</pubDate>
    <dc:creator>AndrewHayden1</dc:creator>
    <dc:date>2018-12-06T15:56:00Z</dc:date>
    <item>
      <title>Use global variable for url parameter in widget config</title>
      <link>https://community.esri.com/t5/web-appbuilder-custom-widgets-questions/use-global-variable-for-url-parameter-in-widget/m-p/772781#M1792</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I'm not sure I'm best articulating the question or the path I'm trying to go down here but I'm wondering about having a configurable value that can be concatenated to a url parameter in a widget config.&amp;nbsp; I have a case where a portion of&amp;nbsp;a url changes based on if the application is a development or production version.&amp;nbsp; As opposed to having&amp;nbsp;a dev and prod config for each widget that has different dev and prod urls, I'd like to just have a configurable value I can set that will be concatenated to the rest of whatever url value is in the widget config.&amp;nbsp; I was thinking, I could set a global variable when the application loads maybe something like var PrdOrDev = 'PartOfUrlThatMakesItPrdorDev' and then in my widget config change the url parameter to "${MyDeploymentVersion}/moreurl/arcgis/rest/blah/blh/blah" and then modify processUrlInWidgetConfig in utils.js to handle url.startWith('${MyDeploymentVersion}) by replacing it with window.PrdOrDev.&amp;nbsp; For anyone that's followed me this far, is this a proper track or is it completely off the rails?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 06 Dec 2018 15:56:00 GMT</pubDate>
      <guid>https://community.esri.com/t5/web-appbuilder-custom-widgets-questions/use-global-variable-for-url-parameter-in-widget/m-p/772781#M1792</guid>
      <dc:creator>AndrewHayden1</dc:creator>
      <dc:date>2018-12-06T15:56:00Z</dc:date>
    </item>
    <item>
      <title>Re: Use global variable for url parameter in widget config</title>
      <link>https://community.esri.com/t5/web-appbuilder-custom-widgets-questions/use-global-variable-for-url-parameter-in-widget/m-p/772782#M1793</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Andrew,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp;That is a viable path. The&amp;nbsp;&lt;SPAN style="background-color: #ffffff;"&gt;processUrlInWidgetConfig method is not used be default in the widget though so you would have to modify each widget to use this method be handling a url.&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 06 Dec 2018 16:09:37 GMT</pubDate>
      <guid>https://community.esri.com/t5/web-appbuilder-custom-widgets-questions/use-global-variable-for-url-parameter-in-widget/m-p/772782#M1793</guid>
      <dc:creator>RobertScheitlin__GISP</dc:creator>
      <dc:date>2018-12-06T16:09:37Z</dc:date>
    </item>
    <item>
      <title>Re: Use global variable for url parameter in widget config</title>
      <link>https://community.esri.com/t5/web-appbuilder-custom-widgets-questions/use-global-variable-for-url-parameter-in-widget/m-p/772783#M1794</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks Robert.&amp;nbsp; I hadn't thought of that.&amp;nbsp; In your opinion, is maintaining DEV/PROD config files for each widget the more prudent approach?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 06 Dec 2018 16:26:55 GMT</pubDate>
      <guid>https://community.esri.com/t5/web-appbuilder-custom-widgets-questions/use-global-variable-for-url-parameter-in-widget/m-p/772783#M1794</guid>
      <dc:creator>AndrewHayden1</dc:creator>
      <dc:date>2018-12-06T16:26:55Z</dc:date>
    </item>
    <item>
      <title>Re: Use global variable for url parameter in widget config</title>
      <link>https://community.esri.com/t5/web-appbuilder-custom-widgets-questions/use-global-variable-for-url-parameter-in-widget/m-p/772784#M1795</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;absolutely&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 06 Dec 2018 16:33:12 GMT</pubDate>
      <guid>https://community.esri.com/t5/web-appbuilder-custom-widgets-questions/use-global-variable-for-url-parameter-in-widget/m-p/772784#M1795</guid>
      <dc:creator>RobertScheitlin__GISP</dc:creator>
      <dc:date>2018-12-06T16:33:12Z</dc:date>
    </item>
  </channel>
</rss>

