The Atlassian Community Forums are currently in read-only mode. We will be relaunching on a new platform on September 22 (read more here). We apologize for the extended downtime. For concerns or questions, please email communitymanagers@atlassian.com. See you on the other side, on the new Atlassian Community Forums! :)

×

Forums

Articles
Create
cancel
Showing results for 
Search instead for 
Did you mean: 

[Confluence] SQL Result Manipulation

bchi
March 27, 2013

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

Comments for this post are closed

Community moderators have prevented the ability to post new answers.

Post a new question

0 votes
Answer accepted
bchi
April 2, 2013

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

1 vote
Bob Swift
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Champions.
March 28, 2013

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

bchi
March 28, 2013

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!

bchi
March 31, 2013

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

TAGS
AUG Leaders

Atlassian Community Events