[Confluence] SQL Result Manipulation

I can't seem to find this anywhere.

I am using SQL to pull data into a confluence page. I know graphs are able to manipulate this data into chart form, but I am wondering are there any other tools/methods to manipulate the sql data.

For Example - If I use SQL to pull a list of Successes and Failures, I would like to be able to highlight the successes in green / set a status macro to green / or something along that nature.

If anyone can point me in the right direction in handling a case like this, I would be most appreciative

Thanks

2 answers

1 accepted

So I actually figured out this answer myself.

You are able to manipulate the SQL code to spit out macro data and Confluence will recognize the macro and run it.

Example:

select case when "Revenue" <= "Plan" then '{status:colour=red|title=Bad}'
else '{status:colour=green|title=Good}' end from products

Generally, you just need to write your SQL so that it creates the correct markup to produce the results you want. For example, use a case statement to generate the appropriate emotion icon markup based on the data.

Example producing wiki markup:

select case when "Revenue" >= "Plan" then '(/)' else '(x)' end from products

Yea I was thinking most of the flexability is within the SQL code. Was just wondering weather I could nicely link it with some confluence tools.

Anyway, thanks for the response!

So I actually figured out this answer myself.

You are able to manipulate the SQL code to spit out macro data and Confluence will recognize the macro and run it.

Example:

select case when "Revenue" <= "Plan" then '{status:colour=red|title=Bad}'
else '{status:colour=green|title=Good}' end from products

Suggest an answer

Log in or Sign up to answer
How to earn badges on the Atlassian Community

How to earn badges on the Atlassian Community

Badges are a great way to show off community activity, whether you’re a newbie or a Champion.

Learn more
Community showcase
Posted Jul 10, 2018 in Confluence

We want to see the templates you've created in Confluence!

Hi Community, Jessica here from the Confluence Product Marketing team!  July’s community challenge is all about sharing pictures  — and as an extension of our first post on what ...

862 views 23 12
Join discussion

Atlassian User Groups

Connect with like-minded Atlassian users at free events near you!

Find a group

Connect with like-minded Atlassian users at free events near you!

Find my local user group

Unfortunately there are no AUG chapters near you at the moment.

Start an AUG

You're one step closer to meeting fellow Atlassian users at your local meet up. Learn more about AUGs

Groups near you