Select to view content in your preferred language

How to set multiple conditions definitionExpression

721
1
07-13-2017 12:26 PM
DasNobel
Emerging Contributor

Hi,

I want to set multiple condition in definitionExpression. Below is the code which I am using:

self.featureLayer.definitionExpression = "Name = '47 MARKET STREET, NEW YORK, NY ,10002'|| Name = '621 WATER STREET, NEW YORK, NY ,10002"

But does not get any result. Can you please provide me correct definitionExpression?

Right now I am using arcgis runtime ios sdk 100.0

Thanks,

Kamal

Tags (1)
0 Kudos
1 Reply
MarkDostal
Esri Regular Contributor

Thanks for your question!  The FeatureLayer "definitionExpression" property is simply a SQL Where clause.  So in your example, you would need to use "OR" instead of "||" for it to be valid SQL.

For example:

                fl.definitionExpression = "Name = 'Kimi' OR Name = 'Sebastian'"

So as long as your feature layer has a field named "Name" which contains features with those exact names, you should be good.

Let me know if you have any problems,

Mark

0 Kudos