Forum Discussion
Since you're combining strings you need to put & between the different components so QB knows to combine them properly.
See below:
"Current State is" & ToText([state]) & ". Current Target Completion Date is" & [target completion date] & "."
------------------------------
Chayce Duncan
------------------------------
Awesome, thank you!! Do you know if it's possible to put an if statement in there to show [state] in red, yellow, or green font depending on what the state says? Similar to this, but something that actually works:|
"Current State is " &
If((ToText([State])="red"), <span style="color:red">[state]</span>, If((ToText([State])="yellow"), <span style="color:yellow">[state]</span>, <span style="color:green">[state]</span> &
". Current Target Completion Date is " & [Target Completion Date] & "."
------------------------------
Elizabeth Schlagel
------------------------------
- ChayceDuncan12 months agoQrew Captain
You're close - since you're inserting tags with inline style you have to be careful with using " versus ' since the html needs one or the other while Quickbase still needs to make sure it can read the entire thing as one long string. Modify it as follows (take note that I refactored your if to be a little cleaner since it was a little hard to read with multiple if statements)
"Current State is " &
If(ToText([State])="red", "<span style='color:red'>",
ToText([State])="yellow", "<span style='color:yellow'>",
ToText([State])="green", "<span style='color:green'>",
"<span>") & [state] & "</span>" &
". Current Target Completion Date is " & [Target Completion Date] & "."Notice in the above that the inline style for your colors are in ' as opposed to having ". This makes it a little more readable in my opinion.
------------------------------
Chayce Duncan
------------------------------- ElizabethSchlag12 months agoQrew Trainee
Thank you, this worked perfectly. Thank you for pointing out the differences between " and ' as well in quickbase.
------------------------------
Elizabeth Schlagel
------------------------------