Discussions

Expand all | Collapse all

Not Null

  • 1.  Not Null

    Posted 10-19-2018 21:12
    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?



  • 2.  RE: Not Null

    Posted 10-19-2018 21:22
    Consider using the List command to concatenate text. It ignores the delimiter and the accompanying field if it is null.


  • 3.  RE: Not Null

    Posted 10-19-2018 21:23
    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


  • 4.  RE: Not Null

    Posted 10-22-2018 14:42
    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])


  • 5.  RE: Not Null

    Posted 10-22-2018 14:45
    I was able to get it using "<br>" rather than the "\n


  • 6.  RE: Not Null

    Posted 10-22-2018 14:48
    The <br> is when you have a Rich Text field type
    The \n is for a regular text field type.


  • 7.  RE: Not Null

    Posted 10-22-2018 14:50
    I love learning new things :)