Forum Discussion
CharlesGuilbert
9 years agoQrew Member
There is no way to run a loop in QuickBase formula. Therefore, there is a lot of repeating syntax. I built it out for 4 users. This would need to be built out for 20 users total. Also, users are hard coded which is going to be a pain to maintain over time. Good Luck!
var text jackstyle = "background: purple; color: white; border-color: purple'>Jack";
var text janetstyle = "background: yellow; color: black; border-color: yellow'>Janet";
var text carolstyle = "background: red; color: white; border-color: red'>Carol";
var text barbarastyle = "background: blue; color: white; border-color: blue'>Barbara";
var text css = "display: inline-block; margin: 1px; background: white; max-width: 98%; "&
"text-overflow: ellipsis;word-wrap: break-word; background: red; border: 1px solid rgb(204, 213, 240);" &
"border-radius: 5px; padding: 2px; -moz-border-radius: 5px; -webkit-border-radius: 5px;";
var text usera = Part(ToText(
var text jackstyle = "background: purple; color: white; border-color: purple'>Jack";
var text janetstyle = "background: yellow; color: black; border-color: yellow'>Janet";
var text carolstyle = "background: red; color: white; border-color: red'>Carol";
var text barbarastyle = "background: blue; color: white; border-color: blue'>Barbara";
var text css = "display: inline-block; margin: 1px; background: white; max-width: 98%; "&
"text-overflow: ellipsis;word-wrap: break-word; background: red; border: 1px solid rgb(204, 213, 240);" &
"border-radius: 5px; padding: 2px; -moz-border-radius: 5px; -webkit-border-radius: 5px;";
var text usera = Part(ToText(
- ), 1, ";");
var text userb = Part(ToText(
- ), 2, ";");
var text userc = Part(ToText(
- ), 3, ";");
var text userd = Part(ToText(
- ), 4, ";");
var text useraf = If(
Contains($usera, "jack")=true, $jackstyle,
Contains($usera, "janet")=true, $janetstyle,
Contains($usera, "carol")=true, $carolstyle,
Contains($usera, "barbara")=true, $barbarastyle
);
var text userbf = If(
Contains($userb, "jack")=true, $jackstyle,
Contains($userb, "janet")=true, $janetstyle,
Contains($userb, "carol")=true, $carolstyle,
Contains($userb, "barbara")=true, $barbarastyle
);
var text usercf = If(
Contains($userc, "jack")=true, $jackstyle,
Contains($userc, "janet")=true, $janetstyle,
Contains($userc, "carol")=true, $carolstyle,
Contains($userc, "barbara")=true, $barbarastyle
);
var text userdf = If(
Contains($userd, "jack")=true, $jackstyle,
Contains($userd, "janet")=true, $janetstyle,
Contains($userd, "carol")=true, $carolstyle,
Contains($userd, "barbara")=true, $barbarastyle
);
"<span style='" & $css &
List("</span><span style='" & $css,
$useraf,
$userbf,
$usercf,
$userdf,
""
)&
"</span>