Kingsfield Posted November 13, 2008 Share Posted November 13, 2008 Hi Again, I have to assign colour to 3 more variables, the current script works fine for 2 variables in the column, however we need to add 3 more variables. if (ToLower(parts[0]) == "kitten") format = "<color name=Blue>"+"Kitten:"; and if (ToLower(parts[0]) == "Puppy") format = "<color name=Green>"+"Puppy:"; if (ToLower(parts[0]) == "ferret") format = "<color name=Black>"+"Ferret:"; Please see the script below that works for the 2 variables. I need help :confused: var fieldval = NormalizeEntities(Field("Sample 1 For Export")); var parts = fieldval.split(":"); if (parts.length < 2) return fieldval; var format = ""; if (ToLower(parts[0]) == "cat") format = "<color name=Red>"+"Cat:"; else format = "<color name=Black>"+"Dog:"; return format + parts[1]; Link to comment Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.