I am looking to implement more URL parameters in an Experience Builder that contains almost 20 layers. I would like to dynamically create parameters for each layer based on a particular ID attribute in that layer.
However, the difficulty for this is that the data source name is not intuitive, something like datasource_2-abcdefgh-layer30, and that is hard to set up for allowing dynamic URLs for all layers.
Does anyone have experience working around this and having the data source name be a bit more intuitive (e.g., using the layer item portal ID instead?) - for example, in ArcGIS Assistant in JSON?
If there is no reported workaround for this, I can submit an ArcGIS Idea to see if the data source ID can be shifted to the actual layer item ID.
I'm wondering what it is about data sources that is troubling you. I know they aren't given good names sometimes, If you are doing custom widget work, one way to handle this is in settings, create an enumeration where each value represents a specific feature layer. Then when you assign each layer in the setting you will know that ID goes with that layer programmatically.
(I've done this multiple different ways, you can have a list of names (so you have a string label for each setting) and spit them out as you assign them one on one, or hard code each drop down to be setup to a particular enumeration.
Let me know if that's helpful, or if you need more.
Hi @TimWestern, thank you for your response! It's mainly due to data sources and how they are named being less intuitive, and the item ID being more concrete, sensible and easier to scale outwards or manage long-term.
We are not using custom widgets, rather looking to utilize the URL parameters built into Experience Builder online. Our use case at the moment, is to generate custom URLs for each of our thousands of our assets, across dozens of our layers. So essentially we may have a Power BI dashboard, or a table, that would link our asset manager to the correct layer of interest. We can still do so by connecting what layer is with what data source ID, but it would be less easy to manage long-term. Let's say we deleted the layer from the map and added it back in, I am thinking the data source would change (?) and thus it would break the links as well.
Let me know if that makes sense! I think there is a potential workaround using data sources, but it's not ideal for our cases.