In Stock”, “ In Stock”, “
Previous Thread
Next Thread
Print Thread
Joined: Mar 2017
Posts: 25
L
L10
Offline
Adagio Enthusiast
Adagio Enthusiast
L Offline
Joined: Mar 2017
Posts: 25
Hi Everyone,

I want to add a this formula my gridview:

IF({quantity} >= 1, “<font size="4" color="green">In Stock</font>”, “<font size="4" color="orange">ETA 2-5 days</font>”

Where the result if true will be:
<font size="4" color="green">In Stock</font>

And if false:
<font size="4" color="orange">ETA 2-5 days</font>

However the quotes inside my html code for the true and false responses, break the formula. I need those in there for HTML, is there any way to ignore them?


Thanks


Lance Tennier
TDL Canada
Joined: Mar 1999
Posts: 11,762
Adagio Action Team
Adagio Action Team
Joined: Mar 1999
Posts: 11,762
Hi Lance,

Do you want the entire row in the GridView inquiry to have the conditional green/orange colour, or just the quantity column? Both of these can be accomplished without HTML.

For the entire row, create a named Row Format (from the Format menu) that uses a simple IF formula:

IF({quantity} >=1, "In Stock Green Style", "ETA 2-5 Days Orange Style")

where "In Stock Green Style" and "ETA 2-5 Days Orange Style" are named Styles in GridView that you create from the Format / Styles menu, creating font styles for size, colour, etc. Of course they can be named differently than this.

For just the specific quantity column, highlight that column in the grid and select Format / Conditional Styles. Ensure the Enable Conditional Styles checkbox is selected, and enter a similar formula:

IF(#>=1,"In Stock Green Style", "ETA 2-5 Days Orange Style")

where # simply represents the current column (ie the quantity).

Is there a particular reason why you wanted to use HTML?


Regards,
Softrak Tech Support
Joined: Mar 1999
Posts: 10,504
Adagio Master
Adagio Master
Joined: Mar 1999
Posts: 10,504
Use the CHR(34) function for the Quote, like this:
Code:
IF({quantity} >= 1, 
    CONCATENATE(
     "<font size=",
     CHAR(34),
     "4",
     CHAR(34)),
   "FOO")


You need to replace every quote character you need with a call to CHAR(n).


Andrew Bates
Joined: Mar 2017
Posts: 25
L
L10
Offline
Adagio Enthusiast
Adagio Enthusiast
L Offline
Joined: Mar 2017
Posts: 25
Yes, it needs to be HTML because this field gets uploaded to our website.

Thanks Andrew, it looks weird, but it works!

This was my final result:

Code:
IF({quantity} >= 1,
CONCATENATE("<font size=",CHAR(34),"4",CHAR(34),"color=",CHAR(34),"green",CHAR(34),">In Stock</font>"),
CONCATENATE("<font size=",CHAR(34),"4",CHAR(34),"color=",CHAR(34),"orange",CHAR(34),">ETA 2-5 Days</font>")
)


Lance Tennier
TDL Canada

Moderated by  Softrak Support 

Link Copied to Clipboard
Who's Online Now
0 members (), 1,193 guests, and 3 robots.
Key: Admin, Global Mod, Mod
Forum Statistics
Forums5
Topics14,680
Posts71,643
Members1,874
Most Online1,408
Dec 9th, 2025
November
S M T W T F S
1 2 3 4 5 6 7
8 9 10 11 12 13 14
15 16 17 18 19 20 21
22 23 24 25 26 27 28
29 30
Powered by UBB.threads™ PHP Forum Software 8.0.0