Select to view content in your preferred language

Add a custom action in built-in ESRI's widget

237
4
Jump to solution
12-02-2024 05:58 AM
ŁukaszWiszniewski
Emerging Contributor

Hello,
I would like to add an action to embedded widget called Query. After querying data, the four squares button in results panel suppose to contain my additional option Select on map and Add to my custom widget.
How can I achieve that? I know about possibility to create my own Query widget based on its code and extend it but I wish rather to extend actions in embedded Query.
Another option is to somehow add option of selecting queried features in the map widget because by default there is only zoom to, pan to but not select.

ukaszWiszniewski_0-1733147881118.png

 

0 Kudos
1 Solution

Accepted Solutions
JeffreyThompson2
MVP Regular Contributor

For the record, the Action to select using the Query Widget should have been Record Selection Changes > Framework > Select Data Records > Your Data Action. I'm glad you were able to find it.

So after selecting some features, you need to send your selection to a custom widget? Yes, that will require developing a custom widget. You could start by copying the OOTB Query Widget and modifying it. Although I generally find it easier to start custom widgets from scratch rather than starting from an ESRI widget. I would build the query function as part of your Subsurface Viewer Widget.

Another option might be to write the Subsurface Viewer to automatically run off of selected data, so the end-user doesn't need to pick something from a menu at all.

GIS Developer
City of Arlington, Texas

View solution in original post

4 Replies
JeffreyThompson2
MVP Regular Contributor

No custom development is necessary for this. You can configure an Action. In the Action Tab under Message Action, add a Record Selection Changes > Select Data Records > Your Data Action. Whatever is clicked in the Query Widget should be selected in the map as well.

GIS Developer
City of Arlington, Texas
0 Kudos
ŁukaszWiszniewski
Emerging Contributor

Thanks for advice. Perhaps it would work but I cannot find any option like select on map. Look at the picture below.

ukaszWiszniewski_1-1733224178982.png

Anyway, I believe it will not help too much because even though I would have selected lines on the map then I still have too add these lines to my custom widget. To do so, I would have to use an custom action available after manual selection of a single line on the map. If I click on the map after selected lines by querying then this selection will disappear.
Mentioned custom actions are created in action.tsx in my custom widget and are available in the pop-up of selected element on the map.

ukaszWiszniewski_0-1733224068313.png

I have the same custom actions implemented in Web App Builder and those are available in the query widget as well. That is what I would like to achieve also in Experience Builder Query widget.

ukaszWiszniewski_2-1733224282030.png

 



0 Kudos
ŁukaszWiszniewski
Emerging Contributor

I found out how to select queried line/lines but as I mentioned in my last reply I am still not able to trigger my custom action available in the pop-up because to open a pop-up I have to click on any of queried lines. Then entire selection disappears.

ukaszWiszniewski_0-1733229972766.png

That means I need an custom action in the dropdown menu in the query widget. Is it possible to add any?

 

0 Kudos
JeffreyThompson2
MVP Regular Contributor

For the record, the Action to select using the Query Widget should have been Record Selection Changes > Framework > Select Data Records > Your Data Action. I'm glad you were able to find it.

So after selecting some features, you need to send your selection to a custom widget? Yes, that will require developing a custom widget. You could start by copying the OOTB Query Widget and modifying it. Although I generally find it easier to start custom widgets from scratch rather than starting from an ESRI widget. I would build the query function as part of your Subsurface Viewer Widget.

Another option might be to write the Subsurface Viewer to automatically run off of selected data, so the end-user doesn't need to pick something from a menu at all.

GIS Developer
City of Arlington, Texas