Skip to main content

conditional statement in map tip

Comments

4 comments

  • John Nerge

     

    No, but that would be awesome. The workaround I've used is to write the conditional expressions in a one-to-one data link and then use the fields from there in my map tip.
    0
  • Permanently deleted user
    I have that problem also, can you elaborate or show a sample of it?  

     

    my problem, for example is:

     

    if a value of the field is equal to 0 or null, do not show the field value and text associated with, otherwise show it.

     

     
    0
  • Permanently deleted user
    @Jeff, basically in the datalink you would specify it as a condition in the where clause. It is limited but works for yes/no cases. For example if we have a datalink named valueConnection.

     

    select "value is null" valueNull, description, contact, category from dummyTable where value is null

     

    Then in the map tip you would have {valueConnection.valueNull} which would input your message.

     

    I have also used this to display workflow links conditionally. For example where an image exists in the database for a feature please display a link to allow download of that image.

     

    @Jeff for your case in particular it might use the SQL case statement. I haven't tested this one but it should be close to correct.

     

    select case when value is null then "value is null" valueNull else value end, description, contact, category from dummyTable where value is null
    0
  • Permanently deleted user
    Hi to all

     

    Unfortunately my use of this strategy fails a bit with the HTML5 viewer as compared to the Silverlight viewer. With the Silverlight viewer consuming the Datalink i can include carriage returns, tabs etc in a concatenated string and have those non-visible white characters get honored on display. However the HTML5 viewer ignores the existence of those just as in any other bit of HTML

     

    Would be great if there is a way to embed  formatting characters but despite having tried a number of options, I have yet to find one that works.

     

    Regards

     

    Ralph
    0

Please sign in to leave a comment.