How to hyperlink the SQL macro results

This article explains how to convert results generated by the SQL for Confluence app into hyperlinks that navigate you to intended pages. 


Consider an example where you are fetching a list of users from MySql database.

  1.  Fetch the list of users from the database using the following SQL query. 

    select user_name from cwd_users;

  2. To convert the result to a clickable hyperlink, use the SQL CONCAT function in a SQL query and make output format as wiki in the SQL macro.

    select CONCAT('[',user_name,'|serverURL/admin/users/viewuser.action?username=',user_name,']') as user_name from cwd_user;
  3. The above query adds user profile links as hyperlinks to the users list as shown in:

  4. Click any of the hyperlinks to navigate to the respective user profile page to view the user deatils.

Find answers from the community.

Ask a question to the community.

Log a request with our support team.

Confluence®, Jira®, Atlassian Bamboo®, Bitbucket®, Fisheye®, and Atlassian Crucible® are registered trademarks of Atlassian®
Copyright © 2005 - 2022 Appfire | All rights reserved. Appfire™, the 'Apps for makers™' slogan and Bob Swift Atlassian Apps™ are all trademarks of Appfire Technologies, LLC.