Book a Demo

Author Topic: Is it possible to remove the heading if the field is empty?  (Read 4421 times)

Kristofer

  • EA User
  • **
  • Posts: 52
  • Karma: +0/-0
    • View Profile
Is it possible to remove the heading if the field is empty?
« on: January 22, 2018, 08:04:24 pm »
I have a fragment which is a custom SQL query returning the note of a specific tagged value of the element. Above this note text is a heading. I would like that if the note is empty, or if the tag does not exists, the heading is removed because there will be no text beneath the heading. Is this possible?

I have tried with Bookmark.Start and Bookmark.End which works in other situations, but could not get it to work in this case.


Arshad

  • EA User
  • **
  • Posts: 291
  • Karma: +21/-1
    • View Profile
Re: Is it possible to remove the heading if the field is empty?
« Reply #1 on: January 22, 2018, 08:25:57 pm »
Hi Kristofer

There isn't any direct way for hiding the heading if the value doesn't exists.
But there are some other work around for your requirements.

A workaround for it ( might be a dirty way   ;) ;) ;) ) run the query first and get the count of the results or the value (note ) . If count is greater than 0 or the value is not empty then you can call the fragment in the script.  ;) DocumentScript and CustomScript will be more convenient for these kind of workarounds.
« Last Edit: January 22, 2018, 08:32:42 pm by EAUser3200 »

Kristofer

  • EA User
  • **
  • Posts: 52
  • Karma: +0/-0
    • View Profile
Re: Is it possible to remove the heading if the field is empty?
« Reply #2 on: January 22, 2018, 09:55:43 pm »
Thanks for the information.

Too bad there is no easier way to do it.