BuildPro
4 years agoQrew Captain
"Contains" formula with colorization
This is what I am trying to do in a field called PRIME PT/UP DATE.COLOR
If [PRIME PT/UP DATE] contains Monday, (red button with M)
If [PRIME PT/UP DATE] contains Tuesday, (yellow button with T)...and so on
I am using this formula in another field...but, I do not know how to include the "If Contains":
var text ButtonColor = Case([Customer Initials],
"SM","#808000", // olive green
"KB20","#ffc966", // golden orange
"NVR","#ede7d3", // cream
"PUL","#003366", // navy blue
"TRU","#ff884d", // peach orange
"DWH","#004d99",
"GRH","#00cccc");
var text WordsColor = Case([Customer Initials],
"NVR","black",
"white");
// Begin button style
var text bgcolor = $ButtonColor;
var text txtcolor = $WordsColor;
var text style = "style=\"text-decoration: none; text-align: center; background:" & $bgcolor & "; width: 45px; border-radius: 50px; padding: 3px 5px; color: " & $txtcolor & "; display: inline-block; font: normal 500 16px/1 \"Calibri\", sans-serif; text-shadow: none;";
// End button style
var text URL = URLRoot() & "db/" & Dbid() & "?a=dr&rid=" & [Customer ID#];
"<a " & $style & " href=" & $URL & ">" & [Customer Initials] & "</a>"
------------------------------
BuildPro
------------------------------
If [PRIME PT/UP DATE] contains Monday, (red button with M)
If [PRIME PT/UP DATE] contains Tuesday, (yellow button with T)...and so on
I am using this formula in another field...but, I do not know how to include the "If Contains":
var text ButtonColor = Case([Customer Initials],
"SM","#808000", // olive green
"KB20","#ffc966", // golden orange
"NVR","#ede7d3", // cream
"PUL","#003366", // navy blue
"TRU","#ff884d", // peach orange
"DWH","#004d99",
"GRH","#00cccc");
var text WordsColor = Case([Customer Initials],
"NVR","black",
"white");
// Begin button style
var text bgcolor = $ButtonColor;
var text txtcolor = $WordsColor;
var text style = "style=\"text-decoration: none; text-align: center; background:" & $bgcolor & "; width: 45px; border-radius: 50px; padding: 3px 5px; color: " & $txtcolor & "; display: inline-block; font: normal 500 16px/1 \"Calibri\", sans-serif; text-shadow: none;";
// End button style
var text URL = URLRoot() & "db/" & Dbid() & "?a=dr&rid=" & [Customer ID#];
"<a " & $style & " href=" & $URL & ">" & [Customer Initials] & "</a>"
------------------------------
BuildPro
------------------------------