Select to view content in your preferred language

trigger embed code widget through button widget

233
2
10-09-2024 03:03 AM
tendtreesTC
Occasional Contributor

I am trying to build an application through experience builder which allows me to select a point feature and create a buffer around that selected feature based on a field within the feature data.  This buffer need to be then loaded into another feature as a polygon which I can then adjust as required.

I need all of this to occur while out in the field which is where the biggest challenge is.  

I have written the JavaScript to do this and have hosted it on GitHub.

I'm now struggling to find a way to trigger this from experience builder.  

I have tried putting a code into the embed widget to allow for the process to occur however I can't get the button widget to trigger the embedded widget.

Am I missing something or is there a better way to do this?

Any help would be much appreciated.

Thank you

0 Kudos
2 Replies
JeffreyThompson2
MVP Regular Contributor

One way or another, you will probably need to develop a custom widget to handle this logic. If by "hosted on GitHub", you mean there is an external website that accepts URL parameters, there could be a possible way to trigger it from the Embed Widget. But I think you will still be better off with a custom widget built within Experience Builder.

GIS Developer
City of Arlington, Texas
TimWestern
Frequent Contributor

So, I know people do some quirky things with GitHub, but GitHub is a source code repository, its not really intended to serve live running code last I heard.  It's a place to check in changes, so you have tracking, a place where you can report and track issues, even create a wiki and online documentation.   But beyond that, I'm not sure how well it works trying to server javascript from it.  You likely need to host your widget somewhere that is an actual web server, and then set it up something like what is suggested here:

https://doc.arcgis.com/en/web-appbuilder/11.3/create-apps/add-custom-widgets.htm

Edit I just realized that's web app builder (i'll leave it hear for posterity)

Other references you might consider here:
https://www.esri.com/arcgis-blog/products/arcgis-enterprise/developers/add-experience-builder-custom...

https://doc.arcgis.com/en/experience-builder/11.0/configure-widgets/add-custom-widgets.htm

0 Kudos