Home > Forum > General > Advanced coloring date fields in reports

Advanced coloring date fields in reports
0

Hi there,
I'm trying to work out a rule to color backround of a date cell. The condition would be "if the date in the current field is greater than today, then color backround, else dont change the color". Currently the not working JSON code is:

{
"content": "=CurrentField",
"style": {
"background-color": "=if(CurrentField > today, '#FF0000', '')"
}
}

I've also tried different variants of the condition like "date(CurrentField) > date(today)" or "CurrentField > date('TODAY')" and other similar, but none worked. Please help :)

MVP

I'm digging an old thread, but I've faced same trouble today, and had to add something new to make it work, so why not make an update :)
This is my final config, that works for Date columns (i didn't need time part, changing today() to now() should do the work though)

{
"content": "=CurrentField",
"style": {
"background-color": "=if(date(CurrentRawValue) > today(), '#FF0000', '')"
}
}

MVP
In reply to: Paweł Tołoczko

Thank you,
the article is not clear ....

https://kb.webcon.pl/zaawansowane-kolorowanie-raportow/
https://kb.webcon.pl/kolorowanie-komorek-w-raportach-aplikacji/

help is not helping ...
https://docs.webcon.com/pl/docs/2024R1/Portal/Reports/Views

we need tutorial ... user voice ?
links to dev part of portal (with explanation) .. are death as well ...
refering to:
[quote="webcon"]
Konfiguracja w trybie zaawansowanym jest możliwa przy użyciu formatu JSON – schemat tworzenia takiej konfiguracji znajdziesz pod linkiem: http://developer.webcon.com/json-schemas/v1/column-formatting.schema.json.
[/quote]

----edit----
should I go here? https://files.webcon.com/bps/reports/column-formatting.schema.v3.json

Yeah, this link: https://files.webcon.com/bps/reports/column-formatting.schema.v3.json is the latest version of schema, which shows up on choosing Advanced formatting, so this is the best place to check the schema.

Mixing schema with this article: https://kb.webcon.pl/zaawansowane-kolorowanie-raportow/ leads to some possibilities, but there are so many options that I don't think a single article will be able to cover them.

Privacy overview

This website uses cookies so that we can provide you with the best user experience possible. Cookie information is stored in your browser and performs functions such as recognizing you when you return to our website and helping our team to understand which sections of the website you find most interesting and useful.


To see a full list of the cookies we use and learn more about their purposes, visit our Privacy Policy.