Not Null

  • 0
  • 1
  • Question
  • Updated 2 months ago
  • Answered
I am writing a formula Rich Text field that is getting a bit complicated.  I am combining 4 text fields together, making the contents bold and italicized. 
Original formula:"<i><b>" & [CT - Q1 Comments] & "<br>" & [CT - Q2 Comments] & "<br>" & [CT - Q3 Comments] & "<br>" & [CT - Q4 Comments]

Then I saw when some of the comments are blank, there was extra space (I assume this is the breaks even though there is no text.  So I feel like I need to adjust the formula to contain nested If/And statements:
If [CT - Q1 Comments] = Blank and [CT - Q2 Comments], [CT - Q3 Comments], [CT - Q4 Comments] are Not Blank then "<i><b>" & [CT - Q2 Comments] & "<br>" & [CT - Q3 Comments] & "<br>" & [CT - Q4 Comments]

I believe this is going to end up being a pretty long formula since I would need to have every variation of each comment being blank.

I believe since these are text fields I would want [CT - Q1 Comments] = null however I don't know how to say [CT - Q2 Comments] Is not null.  I tried the not IsNull( ) but it didn't like that.

Any suggestions?

Photo of Stephanie

Stephanie

  • 732 Points 500 badge 2x thumb

Posted 2 months ago

  • 0
  • 1
Consider using the List command to concatenate text. It ignores the delimiter and the accompanying field if it is null.
Photo of QuickBaseCoach App Dev./Training

QuickBaseCoach App Dev./Training, Champion

  • 52,928 Points 50k badge 2x thumb
The List Function separates non null elements with a separator.  ie it will not add extra spaces or dashes or commas (whatever your separator is, if there is nothing to separate.

Here is an example if how it is used

https://login.quickbase.com/db/6ewwzuuj?a=dr&r=e2&rl=hdi
Photo of Stephanie

Stephanie

  • 732 Points 500 badge 2x thumb
Thank you, I am able to get them together but can't get them on separate lines:

"<i><b>" & List("\n", [SA - Q1 Comments],[SA - Q2 Comments], [SA - Q3 Comments],[SA - Q4 Comments], [SA - Q5 Comments], [SA - Q6 Comments], [SA - Q7 Comments], [SA - Q8 Comments], [SA - Q9 Comments], [SA - Q10 Comments], [SA - Q11 Comments], [SA - Q12 Comments])
Photo of Stephanie

Stephanie

  • 732 Points 500 badge 2x thumb
I was able to get it using "<br>" rather than the "\n"
Photo of QuickBaseCoach App Dev./Training

QuickBaseCoach App Dev./Training, Champion

  • 52,928 Points 50k badge 2x thumb
The <br> is when you have a Rich Text field type
The \n is for a regular text field type.
Photo of Stephanie

Stephanie

  • 732 Points 500 badge 2x thumb
I love learning new things :)