Forum Discussion

OwenMorgan's avatar
OwenMorgan
Qrew Member
6 years ago

Displaying a text value

Hello, 
I have 2 fields that record a reference number
[Case ID] (key field) and (numeric)
[Case ID from import] (contains legacy data from an old system).  (numeric)

I have created a Formula Rich Text field to combine and display these values in a large format at the top of a form.
 
"<span style='font-size:150%; font-weight:bold'>" &
If(not IsNull([Item ID From Import]), ToText([Item ID From Import]), ToText([Case ID]))
& "</span>"

The Item ID is pulling through but I must be missing something because if there is an [Item ID from Import] I see it but if not I just see a "0", not [Case ID]. 

I also tried this as 

"<span style='font-size:150%; font-weight:bold'>" &
If(not IsNull([Item ID From Import]), ([Item ID From Import]) &
If(isNull([Item ID from Import]), [Case ID]))
& "</span>"

But only the first part seems to work!

------------------------------
Owen Morgan
------------------------------
  • Deselect "Treat blank values as "0" in calculations" and try your first solution again.



    ------------------------------
    Adam Keever
    ------------------------------
    • OwenMorgan's avatar
      OwenMorgan
      Qrew Member
      Thanks Adam - this worked with the first formula!

      ------------------------------
      Owen Morgan
      ------------------------------
  • BabiPanjikar's avatar
    BabiPanjikar
    Qrew Assistant Captain
    Checking null values for lookup fields is sometimes cheeky and moody.  try doing this.

    If( ([Item ID From Import] +1>=1), ([Item ID From Import]) ,ToText([Case ID]))

    ------------------------------
    Babi Panjikar
    ------------------------------