Expand my Community achievements bar.

SOLVED

Change fill color of text field if entered text is equal to that in another field

Avatar

Former Community Member

I am looking for a way to highlight when two cells match.  For, instance if the text in cell 1 is Yes, and the text in cell 2 is Yes, I want both to turn green.  Otherwise they can turn red.

I've tried several bits of script I've found online, but none seem to be working.  Could also be that I'm not putting it in the right spot?  This is only the second time I've dealt with any scripting in LiveCycle.

The more info you can give me the better!

Thanks,

Bacon

1 Accepted Solution

Avatar

Correct answer by
Former Community Member

Figured it out - for others who might struggle with things I struggle with:

if(Cell1.rawValue != Cell2.rawValue) this.fillColor = "255,0,0";

else this.fillColor = "255,255,0";

Goes in the exit field of the cells you want colored, with Cell1 and Cell2 being replaces by binding for necessary cells.

View solution in original post

1 Reply

Avatar

Correct answer by
Former Community Member

Figured it out - for others who might struggle with things I struggle with:

if(Cell1.rawValue != Cell2.rawValue) this.fillColor = "255,0,0";

else this.fillColor = "255,255,0";

Goes in the exit field of the cells you want colored, with Cell1 and Cell2 being replaces by binding for necessary cells.

The following has evaluated to null or missing: ==> liqladmin("SELECT id, value FROM metrics WHERE id = 'net_accepted_solutions' and user.id = '${acceptedAnswer.author.id}'").data.items [in template "analytics-container" at line 83, column 41] ---- Tip: It's the step after the last dot that caused this error, not those before it. ---- Tip: If the failing expression is known to be legally refer to something that's sometimes null or missing, either specify a default value like myOptionalVar!myDefault, or use <#if myOptionalVar??>when-present<#else>when-missing. (These only cover the last step of the expression; to cover the whole expression, use parenthesis: (myOptionalVar.foo)!myDefault, (myOptionalVar.foo)?? ---- ---- FTL stack trace ("~" means nesting-related): - Failed at: #assign answerAuthorNetSolutions = li... [in template "analytics-container" at line 83, column 5] ----