Create MailTo Button from table of Mailadresses in confluence
Asked by Robert Mang:

I have a table in confluence. I can use the table transformer plugin. (<https://docs.stiltsoft.com/display/public/TFAC/How+to+use+Table+Transformer+macro>) where is it possible to add sql queries with a reduced set of commands. With `SELECT ARRAY(T1.'email' + " ") FROM T1 WHERE T1.'ART_Role*' LIKE "SM" AND NOT NULL` I was able to get all mail addresses from the table. But still got the problem:

* items are separated by ',' need ';' instead
* got duplicated entries

Can anyone help me how change the separator and remove the duplicates.

Or do you have a better idea to


Answers:
author: Katerina Kovriga {Stiltsoft}
body: Hi [@Robert Mang](/t5/user/viewprofilepage/user-id/4616424) ,

I can suggest the following workaround: wrap your table subsequently into the Table Transformer and then into the Pivot Table macro.

![Fri 10-1.png](https://community.atlassian.com/t5/image/serverpage/image-id/167139i83432D6BCF379C1F/image-size/large?v=v2&px=999 "Fri 10-1.png")

Go to the Table Transformer settings:

![Fri 10-2.png](https://community.atlassian.com/t5/image/serverpage/image-id/167140i9993C1E0960EB8BF/image-size/large?v=v2&px=999 "Fri 10-2.png")

SELECT **DISTINCT** T1.'email' as 'Email List', T1.'ART_Role\*' FROM T1  
WHERE T1.'ART_Role\*' LIKE "SM"

![Fri 10-3.png](https://community.atlassian.com/t5/image/serverpage/image-id/167141i971287F2C7A78CFD/image-size/large?v=v2&px=999 "Fri 10-3.png")

Here we use the DISTINCT command and select only the unique emails.

Then go to the Pivot Table macro settings:

![Fri 10-4.png](https://community.atlassian.com/t5/image/serverpage/image-id/167142i7D3562D2416F2031/image-size/large?v=v2&px=999 "Fri 10-4.png")

Go to the Options tab and set the required separator:

![Fri 10-5.png](https://community.atlassian.com/t5/image/serverpage/image-id/167143i8A3E6280188D3A08/image-size/large?v=v2&px=999 "Fri 10-5.png")

Now when you publish the page and export the result table in the CSV format, you'll get a list separated by the ";":

![Fri 10-6.png](https://community.atlassian.com/t5/image/serverpage/image-id/167144iF7F9059D7E1E1014/image-size/large?v=v2&px=999 "Fri 10-6.png")

![Fri 10-7.png](https://community.atlassian.com/t5/image/serverpage/image-id/167145i649008C71B0D6440/image-size/large?v=v2&px=999 "Fri 10-7.png")

If you don't need the first column, you may use another Table Transformer or Table Filter macro on top of the Pivot Table macro, hide this column and then export your emails.

comments: author: Katerina Kovriga {Stiltsoft}
body: [@Robert Mang](/t5/user/viewprofilepage/user-id/4616424) , I've consulted with our developers and they have a more beautiful solution:

![Fri 10-8.png](https://community.atlassian.com/t5/image/serverpage/image-id/167183iEB0B9420910A5D76/image-size/large?v=v2&px=999 "Fri 10-8.png")

SELECT SUM(DISTINCT T1.'email' + ";")-\>slice(0, -1) as 'Email List' FROM T1  
WHERE T1.'ART_Role\*' LIKE "SM"

![Fri 10-9.png](https://community.atlassian.com/t5/image/serverpage/image-id/167184i6125A8619EA48189/image-size/large?v=v2&px=999 "Fri 10-9.png")

Hope this helps your case.


Tags: confluence-server

server