Feature Layer multiple definition expressions

3034
3
Jump to solution
04-10-2016 12:47 PM
EricBianchi1
New Contributor III

For example, if I have the code:

featureLayer.setDefinitionExpression("TYPE='BLUE'");

Can I set multiple expressions such as TYPE='RED' and TYPE='BLUE'?

If so, what is the proper syntax to do so?

Thanks!

0 Kudos
1 Solution

Accepted Solutions
RobertScheitlin__GISP
MVP Emeritus

Eric,

  Sure it would be:

featureLayer.setDefinitionExpression("TYPE='BLUE' OR TYPE='RED'");

View solution in original post

3 Replies
RobertScheitlin__GISP
MVP Emeritus

Eric,

  Sure it would be:

featureLayer.setDefinitionExpression("TYPE='BLUE' OR TYPE='RED'");

RobertScheitlin__GISP
MVP Emeritus

Eric,


   AND  is used when you want another field to have another value like "Type = 'RED' AND Lot = 'STUDENT'"

KenBuja
MVP Esteemed Contributor

If you have many types, you can also use the syntax

featureLayer.setDefinitionExpression("TYPE in ('BLUE', 'RED')");