Select to view content in your preferred language

Can a popup template be defined in a FeatureLayer Service?

163
1
07-18-2025 07:10 AM
joshk6656
Emerging Contributor

Is it possible to configure a popup template on the FeatureLayer service itself so when the JS API is using the service it is defined, or must you always define it only in the JS?

0 Kudos
1 Reply
LaurenBoyd
Esri Contributor

Hi @joshk6656 -

Yes we highly suggest that you do this! This is the easiest way to configure a popup and consume it in other applications (such as a JS Maps SDK app). You can configure the popup on a feature layer item and then consume that popup in a JS SDK application by loading the feature layer from the portal item. Here's the steps to do so:

  1. Add the service as an item (or publish directly to ArcGIS Online): https://doc.arcgis.com/en/arcgis-online/manage-data/add-item-from-url.htm
  2. Configure popups in Map Viewer on the layer item: https://doc.arcgis.com/en/arcgis-online/create-maps/configure-pop-ups-mv.htm#ESRI_SECTION1_0505720B0... 
  3. Once the popup is configured, note the item ID of the layer.
  4. Take that item ID and create a FeatureLayer from a portal item in your JS Maps SDK application (be sure to expand the "See more" section: https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-FeatureLayer.html#creating... 

Hope this helps!

Lauren
0 Kudos