0

How to check if a rich-text field is empty

I need to control the visibility of some fields based on a rich-text field is empty or not. I do it with the visibility formula

'myRichTextField' != ""

It works with a new dataset where the rich-field is empty. Once there is content in the field (its filled programmatically), it displays correctly. However, when I delete the content manually, the field stays visible. I guess there is some hidden content due to the kind of field.

Does anyone know how to correctly check if a rich-text field is empty or not?

I am using this field type since I need to display some HTML Content.

6 replies

null
    • Mel_Charles
    • 1 yr ago
    • Reported - view

    Maybe add a small button next to it and clear it by script forcing in clear content

    myRichTextField' := null
      • LIEmobil
      • Jurgen_Frick
      • 1 yr ago
      • Reported - view

      Mel Charles thanks, I tried that. It does not work.

    • Fred
    • 1 yr ago
    • Reported - view

    That is kind of whacky. After a bit of testing it looks like if you manually delete the data in your rich text field it leaves behind some html. To make sure the field is truly empty you have to have a button that sets it to null.

    richtextfield := null
    

    You can email support with this and maybe they will get around to it.

    • Ninox partner
    • RoSoft_Steven.1
    • 1 yr ago
    • Reported - view

    What if you try     text(richtextfield)=null ?

      • Fred
      • 1 yr ago
      • Reported - view

      That doesn't work either. I guess the left over html code still makes the field not null.

      But it will work if you switched it to:

      text(richtextfield) = ""

      I guess Ninox doesn't consider html code to text, but it does consider it data.

      For those who are interested you can create another formula field and put this in the code:

      debugValueInfo(richtextfield)
      

      And you can see what happens to the richtextfield.

      • LIEmobil
      • Jurgen_Frick
      • 1 yr ago
      • Reported - view

      Fred Many Thanks, actually that works. 

Content aside

  • Status Answered
  • 1 yr agoLast active
  • 6Replies
  • 223Views
  • 4 Following