<?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: Can I reuse a custom Arcade function in a Web Map popup? in ArcGIS Web AppBuilder Questions</title>
    <link>https://community.esri.com/t5/arcgis-web-appbuilder-questions/can-i-reuse-a-custom-arcade-function-in-a-web-map/m-p/53778#M1514</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi&amp;nbsp;&lt;A href="https://community.esri.com/migrated-users/373619"&gt;Chris Sands&lt;/A&gt;&amp;nbsp;,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I guess it would be less&amp;nbsp;problematic if you would have a single layer for all the counties and only have to apply the expression once. If the county layer all cover a different area, I'm afraid you will have to apply the expression to each layer. In case you have several layers that overlap&amp;nbsp;you could apply a single expression that drills through the different layer and present the information in a single pop-up, but I guess that will not be the case for you.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 08 Apr 2020 15:40:50 GMT</pubDate>
    <dc:creator>XanderBakker</dc:creator>
    <dc:date>2020-04-08T15:40:50Z</dc:date>
    <item>
      <title>Can I reuse a custom Arcade function in a Web Map popup?</title>
      <link>https://community.esri.com/t5/arcgis-web-appbuilder-questions/can-i-reuse-a-custom-arcade-function-in-a-web-map/m-p/53775#M1511</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I am using Arcade to customize the popup in a WAB Web Map.&lt;/P&gt;&lt;P&gt;I am using parcel data in Florida and I have two fields in the data that use the same set of numeric county codes (CO_NO and CONO_PRV_H). I have a function to lookup the numeric value and return the county name. In {expression/expr12} I have function lookupCountyCode(countyCode){... return countyName}.&lt;/P&gt;&lt;P&gt;I would like to be able to call that function from another expression or from the popup configuration, but I have not found any examples of how to do that. The obvious syntax would be&amp;nbsp;&lt;SPAN&gt;{expression/expr12}.lookupCountyCode($feature["CO_NO"]) and then where I need the other value&amp;nbsp;{expression/expr12}.&lt;SPAN&gt;lookupCountyCode(&lt;/SPAN&gt;&lt;SPAN&gt;$feature["CONO_PRV_H"]&lt;/SPAN&gt;&lt;SPAN&gt;) but that doesn't do what I want.&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;&lt;SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;&lt;SPAN&gt;&lt;SPAN&gt;I see "County Code Lookup" (the name I gave my expression) in the Existing functions in the Arcade interface. If I click it, it adds a copy of my code to the current expression. I don't want another copy of the code to maintain. I want a way to call the function from outside the expression and I want to pass in the field as a value. I can't figure out what the syntax is.&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;&lt;SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;&lt;SPAN&gt;&lt;SPAN&gt;I even &lt;SPAN&gt;added a script tag&lt;/SPAN&gt;&amp;nbsp;to the HTML view of the popup Configuration with the lookupCountyCode function in it. &lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;&lt;SPAN&gt;&lt;SPAN&gt;&amp;lt;script type="text/arcade"&amp;gt;function lookupCountyCode(countyCode){...return countyName}&amp;lt;/script&amp;gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;&lt;SPAN&gt;&lt;SPAN&gt;But when I saved the map, the script tag and function vanished.&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;&lt;SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;&lt;SPAN&gt;&lt;SPAN&gt;How can I call this function from outside the expression and pass it a data field as a parameter? Or is this a limitation of Arcade?&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;&lt;SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;&lt;SPAN&gt;&lt;SPAN&gt;Then, once I have resolved this for the first county parcel layer, how can I apply it to all 67 county parcel layers without having to re-create all of my expressions repeatedly?&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 08 Apr 2020 11:40:13 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-web-appbuilder-questions/can-i-reuse-a-custom-arcade-function-in-a-web-map/m-p/53775#M1511</guid>
      <dc:creator>ChrisSands</dc:creator>
      <dc:date>2020-04-08T11:40:13Z</dc:date>
    </item>
    <item>
      <title>Re: Can I reuse a custom Arcade function in a Web Map popup?</title>
      <link>https://community.esri.com/t5/arcgis-web-appbuilder-questions/can-i-reuse-a-custom-arcade-function-in-a-web-map/m-p/53776#M1512</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi&amp;nbsp;&lt;A href="https://community.esri.com/migrated-users/373619"&gt;Chris Sands&lt;/A&gt;&amp;nbsp;,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I hate to tell you but unfortunately, an Arcade expression does not have any knowledge of the existence of other Arcade expressions. It would be a great feature to have! You will have to copy the content of the other Arcade expression and paste it into the one you are writing.&amp;nbsp;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 08 Apr 2020 13:28:43 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-web-appbuilder-questions/can-i-reuse-a-custom-arcade-function-in-a-web-map/m-p/53776#M1512</guid>
      <dc:creator>XanderBakker</dc:creator>
      <dc:date>2020-04-08T13:28:43Z</dc:date>
    </item>
    <item>
      <title>Re: Can I reuse a custom Arcade function in a Web Map popup?</title>
      <link>https://community.esri.com/t5/arcgis-web-appbuilder-questions/can-i-reuse-a-custom-arcade-function-in-a-web-map/m-p/53777#M1513</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thank you. That was not the answer I wanted, but&amp;nbsp;it means I can stop spending time doing something that won't work.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;These popup expressions are associated with the county parcel layer for which they are written. Is it possible to associate the expressions with the group layer that contains all the county parcel layers rather than the individual county parcel layers, so that each of the parcel layers (all with the same fields) can reference the existing expressions?&amp;nbsp;&lt;/P&gt;&lt;P&gt;Or do I need to copy my expressions for each county parcel layer?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 08 Apr 2020 14:09:03 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-web-appbuilder-questions/can-i-reuse-a-custom-arcade-function-in-a-web-map/m-p/53777#M1513</guid>
      <dc:creator>ChrisSands</dc:creator>
      <dc:date>2020-04-08T14:09:03Z</dc:date>
    </item>
    <item>
      <title>Re: Can I reuse a custom Arcade function in a Web Map popup?</title>
      <link>https://community.esri.com/t5/arcgis-web-appbuilder-questions/can-i-reuse-a-custom-arcade-function-in-a-web-map/m-p/53778#M1514</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi&amp;nbsp;&lt;A href="https://community.esri.com/migrated-users/373619"&gt;Chris Sands&lt;/A&gt;&amp;nbsp;,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I guess it would be less&amp;nbsp;problematic if you would have a single layer for all the counties and only have to apply the expression once. If the county layer all cover a different area, I'm afraid you will have to apply the expression to each layer. In case you have several layers that overlap&amp;nbsp;you could apply a single expression that drills through the different layer and present the information in a single pop-up, but I guess that will not be the case for you.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 08 Apr 2020 15:40:50 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-web-appbuilder-questions/can-i-reuse-a-custom-arcade-function-in-a-web-map/m-p/53778#M1514</guid>
      <dc:creator>XanderBakker</dc:creator>
      <dc:date>2020-04-08T15:40:50Z</dc:date>
    </item>
    <item>
      <title>Re: Can I reuse a custom Arcade function in a Web Map popup?</title>
      <link>https://community.esri.com/t5/arcgis-web-appbuilder-questions/can-i-reuse-a-custom-arcade-function-in-a-web-map/m-p/53779#M1515</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks for the answer. Again, not what I was hoping for but good to know.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 08 Apr 2020 17:08:50 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-web-appbuilder-questions/can-i-reuse-a-custom-arcade-function-in-a-web-map/m-p/53779#M1515</guid>
      <dc:creator>ChrisSands</dc:creator>
      <dc:date>2020-04-08T17:08:50Z</dc:date>
    </item>
  </channel>
</rss>

