Download page Conditional inserting of values and coloring cells background.
Conditional inserting of values and coloring cells background
Use case
You need to add values in a newly created column and color its cells through conditions.
Solution
Switch the page to the edit mode.
Insert the Table Transformer macro and paste the table or the macros outputting tables within the macro body.
Select the macro and click Edit.
In the Presets tab select Custom transformation and click Next.
Enter the following SQL query:
SELECT T1.'Employees', CASE WHEN T1.'Job Title'="Developer" THEN FORMATWIKI("{cell:bgColor=#0099FF}Dev{cell}") WHEN T1.'Job Title'="Product Analyst" THEN FORMATWIKI("{cell:bgColor=#00CC00}BI{cell}") ELSE FORMATWIKI("{cell:bgColor=grey}Others{cell}") END AS 'Team' FROM T1 ORDER BY 'Team'