I have an HTML table generated from Lookup Issues values. I'm trying to print some of the values in Red when they are >= 50. I've gotten some success but not consistent. For instance, when the value is 13, it prints in black as expected. When the value is 67 it prints in red which is expected. When the value is 137, it prints in green which is unexpected.
<td align="center"> <font color="{#if {{created.diff(now).days}} < 50}black{#else}red{#/if}"> {{created.diff(now).days}} </font> </td>
My Outlook client did not change any of the colors when trying the CSS formatting:
<td align="center" style="color: {#if {{created.diff(now).days}} > 50}red{#/if}"> {{created.diff(now).days}} </td>
Hi @Randy Simes
For a question like this, please post an image of your complete automation rule, images of any relevant actions / conditions / branches, an image of the audit log details showing the rule execution, and explain what is not working as expected. Those will provide context for the community to offer ideas. Thanks!
Until we see those...
I wonder if the HTML conditional logic is not working due to data type from the diff() function result. Perhaps try using inline, conditional logic for the smart value. Here is an example:
{{#lookupIssues}}
<td align="center"> <font color={{if(created.diff(now).days.lt(50),"black","red")}}> {{created.diff(now).days}} </font> </td>
{{/}}
Kind regards,
Bill
I was just able to get this to work using the following:
{{#if (created.diff(now).days.gte(50))}}<td align="center"><font color="red">{{created.diff(now).days}}</font></td>{{/}}
{{#if (created.diff(now).days.lt(50))}}<td align="center"><font color="black">{{created.diff(now).days}}</font></td>{{/}}
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Online forums and learning are now in one easy-to-use experience.
By continuing, you accept the updated Community Terms of Use and acknowledge the Privacy Policy. Your public name, photo, and achievements may be publicly visible and available in search engines.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.