Do WAB Widgets Work Off of Item ID's?

561
5
10-05-2018 02:36 PM
Amanda__Huber
Regular Contributor

Hi Esri, 

We need to republish new services which currently are in working web maps and Web App Builders. It appears that there is a workflow that would allow us to dig into the JSON and replace the Item ID in the web map using ArcGIS Assistant. ( Reference: How to replace itemId number in Web Map AGOL directly in JSON )  If we change the Item ID in ArcGIS Assistant will Web App Builder widgets respect this change or will they break? We would just like to know the expected behavior to know the time it may take to rebuild these widgets if we need to. 

Thanks so much, 

Amanda

5 Replies
RobertScheitlin__GISP
MVP Esteemed Contributor

Amanda,

  I my experience when making changes to layer in a web map that a WAB app uses will cause issue with widgets that are using specific layers in that web map.

Amanda__Huber
Regular Contributor

Hi Robert, 

Thanks so much for your response. I was wondering, were you referring to changes made in the web map interface itself or changes to the web map in the underlying JSON through ArcGIS Assistant?

I'm aware that swapping out a feature layer in a map will typically break widgets, but what i was wondering is if the layer is not physically changed in the map and just the underlying item id for that layer is pointed to a different service will the widget break?

Thanks so much, 

Amanda

0 Kudos
RobertScheitlin__GISP
MVP Esteemed Contributor

Amanda,

If the layer is not physically changed in the map and just the underlying item id for that layer is pointed to a different service will the widget break?

Sorry I have not tried that.

BrianFausel
Occasional Contributor III

Hi Amanda,

I was experimenting with this recently and my (admittedly quick) initial findings were that you can use the ArcGIS Online Assistant to update ItemIDs and feature service URL references in app widgets. But you need to make sure you properly catch every instance of the URLs/ItemIDs. I was able to get this quick test to work:

  1. Update the web map using the I Want to --> Update the URL of services in the map (as you know, this updates the map but then breaks the widgets).
  2. Update all of the layer references in the I Want To --> View an Items JSON --> click App --> manually Update all URL references and/or ItemID references in the JSON in both the Description and Data areas.

I used Brackets to work with the code, and made sure I backed up the original JSON. In my apps I found that I had to update full URLs for the widgets, not ItemIDs. That is likely the result of the way I added the services to my web map originally - I directly pasted ArcGIS Server URLs rather than add registered services.

Doing these steps (carefully) resulted in a web app with widgets and map layers that were changed from one map service to another. The caveat is, of course, that the feature class data structure should be identical (i.e. same attribute columns). If it isn't, then you might need to dig further into the JSON code. Also, I only tested relatively simple widgets (Search), I don't know how crazy it gets with ones like Infographics.

As with all of this, it would be best to try it in a test version before working on production data. Heed Esri's warning that "this is untested and unsupported"...

Amanda__Huber
Regular Contributor

Hi Brian, 

Thank you so much for testing and explaining your workflow, this is extremely helpful information! 

Thanks, 

Amanda

0 Kudos