I have a table that is build from data coming from an outside source. I want each row to be colored in a color that is comming from a column named Color, which contains RGB value of a color.
Is this possible?
Hi @Alexander Stoyanov ,
You may try the Table Filter and Charts for Confluence app.
Wrap you table in the Table Transformer macro and apply conditional formatting with the help of the Wiki markup:
Type in your custom SQL query:
SELECT
FORMATWIKI("{cell:bgColor=" +
CASE WHEN T1.'Color' LIKE "(122,28,134)" THEN "#7a1c86"
WHEN T1.'Color' LIKE "(10,186,181)" THEN "#0abab5"
ELSE "#ccff00"
END
+ "}" + T1.'Column A' + "{cell}") AS 'Column A with Background',
FORMATWIKI("{cell:bgColor=" +
CASE WHEN T1.'Color' LIKE "(122,28,134)" THEN "#7a1c86"
WHEN T1.'Color' LIKE "(10,186,181)" THEN "#0abab5"
ELSE "#ccff00"
END
+ "}" + T1.'Column B' + "{cell}") AS 'Column B with Background',
FORMATWIKI("{cell:bgColor=" +
CASE WHEN T1.'Color' LIKE "(122,28,134)" THEN "#7a1c86"
WHEN T1.'Color' LIKE "(10,186,181)" THEN "#0abab5"
ELSE "#ccff00"
END
+ "}" + T1.'Color' + "{cell}") AS 'Color with Background'
FROM T*
And preview the result:
And what concerns uploading your source table from the external source, the app also provides the Table from CSV and Table from JSON macros that support outputting data from a URL or an attached file.
Thanks for the replay @Katerina Kovriga {Stiltsoft} . It looks very promising and I was not aware of the table transformer macro. When I paste your code with the sample table you have provided I get
TypeError: alasql.fn.FORMATWIKI is not a function
Where is FORMATWIKI defined?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
@Alexander Stoyanov , @Dom , please, check if the version of the Table Filter and Charts for Confluence app is 6.1.0 or newer.
Here is our documentation about cells formatting with the Table Transformer macro. You'll find a lot of use cases there.
If the version of the app is up-to-date but you still can't reproduce our examples, please, raise a support ticket (specify the version of the app and attach your screenshots, we'll investigate the issue).
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Behind on the version; the major version update has to be vetted so I can't just click the update button. :)
I imagine I will not have any problem once I can update. Thanks!
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
If the table is generated by "table from json" macro, can " Table Transformer" macro be used ?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Yes, all our macros are compatible. So, you can wrap your Table from JSON macro in the Table Transformer, Table Filter, Pivot Table macro, etc. and further transform, filter and aggregate your table.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
And you may also use the Spreadsheet from Table macro for the case: turn your manually created or macro generated tables into live spreadsheets and apply familiar Excel-like conditional formatting.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.