Skip to main content

Can I add a feature action to a context menu to clear all results?

Answered

Comments

5 comments

  • Andrew Adamson

    It is, but it looks like you are using an item picker from workflow to show results. results.clear/remove from web cmds only works on Web's results list/table.

    I tend to avoid item pickers and showing results through them.  Your best bet is to send your parcel results to web's results list/table.

    0
  • Larisa Johnstone

    Thank you Andrew.

    I appreciate you responding to this. Unfortunately that is they way we have to use this. I can't change the item picker.

    Do you know if this can still be done with this in mind?? or how to do it? I can't seem to make anything work

    thanks

     

    0
  • Andrew Adamson

    Ehh i think the item picker has its own logic to handle highlighting and I'm not sure if we have access to disabling the highlighting from that.  What about using a listbox? Not 100% sure if that has auto highlighting when geometry is provided.

    Easy way would be to remove geometry from your features that get appended to the item picker - item picker has nothing to highlight since geo is missing but then you loose the ability to zoom/pan/change extent with any of those features.

    Maybe not the best solution and a little more complex but you could store 2 copies of the selected parcels:
     - featureSetParcelsNoGeo: Remove geo, use these to append to item picker
     - featureSetParcels: Same as 1, but has geometry.

    On item picker change, you could create a value where you filter the selected feature(s) from the item picker back to featureSetParcels. If you allow multiple selects in the itempicker, you'd have to do this in a for each, but assuming only 1 selection:

    Activity - Get Form Event Data
    Name: getFormEventData1

    Activity - Create Value
    Name: selectedParcel
    Value: $featureSetParcels.featureSet.features.filter(ms => ms.attributes.FIELDTOJOIN === $getFormEventData1.value.items[0].data.attributes.FIELDTOJOIN)[0]

    Check if selectedParcel is not undefined, if its not, you found the selected parcel and now have the geometry for the selection.  From there you could store for later use or use to zoom/query/graphics/append to another featureSet/etc

    0
  • Cam Barnard

    Larisa Johnstone ... I'd start by trying these existing tools. One of them, or a combination of them, should be able to clear the stuff you are trying to clear. 

    Clear Drawings

    [
       "map.clear-markup"
    ]

    Clear all Highlighting

    [
    "highlights.clear"
    ]

    Clear all focused items

    [
    "highlights.clear-focus"
    ]

    Clear active set of results

    [
    "results.clear"
    ]

     

    0
  • Larisa Johnstone

    Andrew Adamson and Cam Barnard

    Thank you very much for getting back to me! You have given me a lot to think about and work with. I appreciate your time. I could not have come this far if it were not from help from people like you.  These are the answers I need! I will let you know how this all plays out. 

    Thanks

    Larisa

     

    0

Please sign in to leave a comment.