Select to view content in your preferred language

Is there a way to highlight a selected feature from a query?

716
11
02-21-2025 05:02 AM
SimonCrutchley
Frequent Contributor

When you run a query it is possible to set the results to appear on the map and zoom to them. However, you may have run a query that pulls back tens or even hundreds of records and zooms to the full extent. If you zoom to a single one, by clicking somewhere in the resultant box, the map centres on the feature, but there is no differentiation of the feature. In WAB a highlight box used to appear around the selected feature so you could see it.

There doesn't seem to be any obvious way to do this in EB, unless I'm missing an advanced feature somewhere.

SimonCrutchley_0-1740142769122.pngSimonCrutchley_1-1740142796067.jpeg

Thanks

0 Kudos
11 Replies
JeffreyThompson2
MVP Frequent Contributor

Go to the Action Tab and set up a Record Selection Changes Action. Any of these should highlight your feature on the map. If you just want a highlight, Map > Flash is your best option. You might also want the Map > Zoom To or Pan To or the Framework > Select Data Records options.

GIS Developer
City of Arlington, Texas
0 Kudos
SimonCrutchley
Frequent Contributor

Hi Jeffrey, I've already done this with 'Show on map' and 'Zoom to' for 'Records created' and 'Zoom to' and 'Flash' for 'Record Selection changes'. Unfortunately, as far as I can tell this produces the effects in the query and highlights all the results, not the induvial feature.

0 Kudos
JeffreyThompson2
MVP Frequent Contributor

The Records Created Action activates when the Query is run and should highlight all the queried features. The Record Selection Changes Action should activate when the user interacts with the query results. These Actions should work the way you want. I just tried it. Maybe your highlight color and the symbols from the Records Created Action are too similar? I've also noticed sometimes the order of your Actions makes a difference. 

GIS Developer
City of Arlington, Texas
0 Kudos
SimonCrutchley
Frequent Contributor

Thanks for that, but I'm not quite sure I understand. As far as I can see the only change to symbology I can make is for the 'Show on Map', which only relates to 'Records created'. I can't see any way to change the symbology for 'Record Selection changes'. Am I missing something?

0 Kudos
JeffreyThompson2
MVP Frequent Contributor

JeffreyThompson2_0-1740148209978.png

The Record Selection Changes highlighting is controlled in the Map Widget with the Highlight Fill and Outline options.

GIS Developer
City of Arlington, Texas
0 Kudos
SimonCrutchley
Frequent Contributor

Sorry Jeffrey, but it's still not working for me and changing the feature selection colour in map seems to have made no difference. It was the default cyan, but didn't show before. I've now changed it to red, but it's still not showing. I've tried various triggers within the map, but they don't seem to make any difference. I'm clearly not understanding something.

0 Kudos
JeffreyThompson2
MVP Frequent Contributor

JeffreyThompson2_0-1740151706179.png

I'm not sure why this isn't working either. Here is the order of the Actions I set up.

GIS Developer
City of Arlington, Texas
0 Kudos
SimonCrutchley
Frequent Contributor

My 'Flash' and 'Zoom' were originally in the opposite order, but even though I've changed them still no joy.

Puzzling.

Thanks for your help anyway.

0 Kudos
JeffreyThompson2
MVP Frequent Contributor

What version of Experience Builder (Online, Enterprise) are you using? What kind of layer are you using (Map Image Layer, Feature Layer, Group Layer)? You may have found a bug.

GIS Developer
City of Arlington, Texas