Azure-docs: How to use "And" operator in filter condition - Azure Maps

Created on 27 Jan 2020  Â·  5Comments  Â·  Source: MicrosoftDocs/azure-docs

Could you explain on how to use "And" operator in filter conditions?
Example- I have "Any" operator which get status either "Aborted" or "Delayed", Now i need to include this should match only with location "London" field which requires and operator. The below condition does not work. looks i am doing in wrong. Thanks
['any', ['==', ['get', 'status'], 'Aborted'], ['==', ['get','status'], 'Delayed'],['==', ['get', 'location'], 'London']]


Document Details

⚠ Do not edit this section. It is required for docs.microsoft.com ➟ GitHub issue linking.

Pri2 azure-mapsvc cxp in-progress product-question triaged

Most helpful comment

Ah, didn't see where you wanted the AND when looking on my phone. Try this:

['all', ['any', ['==', ['get', 'status'], 'Aborted'], ['==', ['get','status'], 'Delayed']], ['==', ['get', 'location'], 'London']]]

All 5 comments

@NavaneethaDev Thanks for the feedback! We are currently investigating and will update you shortly.

Replace 'any' with 'all'

Thanks for the suggestion. I have tested with "all" but unfortunately it didn't work.
I am looking for something like below.
filter : ['any', ['==', ['get', 'status'], 'Aborted'], ['==', ['get','status'], 'Delayed']] and ['==', ['get', 'location'], 'London']]
Either anyone of the above status with the specific location and so on.

Ah, didn't see where you wanted the AND when looking on my phone. Try this:

['all', ['any', ['==', ['get', 'status'], 'Aborted'], ['==', ['get','status'], 'Delayed']], ['==', ['get', 'location'], 'London']]]

@rbrundritt . Thanks it worked.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

ianpowell2017 picture ianpowell2017  Â·  3Comments

varma31 picture varma31  Â·  3Comments

mrdfuse picture mrdfuse  Â·  3Comments

monteledwards picture monteledwards  Â·  3Comments

Agazoth picture Agazoth  Â·  3Comments