Skip to main content

conditional statements in long description

Comments

1 comment

  • Permanently deleted user
    Carmen,

     

    I dont think that kind of conditional logic is supported. I have a work-around that I have used several times, which may work for you. I use a query layer in my map service instead of a featrue class and put the conditional logic into the sql that creates the query layer.

     

    I use a CASE statement to create a virtual field that stores the desired values. Something like below: 

     

    Select OBJECTID, Shape, CASE WHEN [fieldA] = 'x' THEN 'Good'  WHEN [fieldA] = 'y' THEN 'OK' ELSE 'Poor' END AS 'Field Name' FROM Carta.GIS.Inspections

     

    The new field 'Field Name' is then part of the data source and can be used in long description.

     

    Note, that query layers work only with SDE data sources and also, not supported in feature services. Other than those restrictions they are great for map services.
    0

Please sign in to leave a comment.