Issues using Color format "Result of template"

Hello Skuid Community!

I am attempting to use the "result of template’ under the Color format on my Calendar component, but having lots of issues.

It’s a relatively simple formula, but whenever I put in any logic all my events render in a gray that isn’t part of my formula. I’m guessing I have something wrong in the syntax, but can’t crack the issue.

Formula:

CASE(
{{AWBC_Party__c}},
“D”,#0015BC,
“R”, #FF0000,
“I”,#6F2DA8,
#FFFFFF)

Calendar rendering as gray, not following template despite both an R and D being present:

image

Any help is greatly appreciated - I’d really like to avoid having three duplicate models powering my calendar, but that is the only idea I can come up with if this feature doesn’t work out.

Best

Woj

After a super cursory review of your question - I think the problem is that the Case function is looking for “=” and not “in” If your AWBC_Party__c field has more text in it than the “R” or the “D” then the match won’t get effected and it falls down to the default #FFFFFF. If you isolate the first letter of the string in your formula, or create a UI ONly field that extracts that first letter - the CASE matching should work.

Something like
CASE(
LEFT({{AWBC_Party__c}}, 1),
“D” …

Hey Rob!

My field is simply the single letter:

image

I did try an ‘IF’ statement as well, but similar results.

Thoughts?

Are you trying to put the formula in the “Color” template directly on the calendar component? I don’t think formulas will process there. Run your formula on a UI Only field on the model and then reference the value of that field in your calendar color template.

1 Like

Rob -

I’m not sure what you mean by ‘run your formula on a UI only field’. I attempted to add a UI Only field that uses my formula as a placeholder, then reference that, but it’s yielding the same results. I feel like I’m just not getting it in the right place:

I also attempted to convert this UI Only field to a Formula type and insert my formula, still no luck.

What do you mean ‘run it on a UI field’? That comes across as 'create it as a UI Only formula field to me.

The first attempt would not have worked. The placeholder property does not process formulas.
The second attempt should have worked.

I often put a placeholder table on my pages with all the model fields in them, just to make sure I’m actually getting the expected values. Does that happen?

Then can you post a picture of your calendar Event Configuration?

Rob -

Thanks for the guidance - I added the table and it helped to troubleshoot where I did and did not need quotes to power the formula. I’m in business, and I know more about leveraging UI Only fields for formulas. Plus - I don’t have three models powering my calendar that I have to maintain!

Sincerely appreciated!

Woj

Always glad to see success!! Thanks for using Skuid…

1 Like