Can you combine multiple fields into one cell of Jira table?
Asked by Laurie Huth:

I am building a table in Confluence (using the 'Jira Issue/Filter' macro). I selected the data I want to display in my table, i.e. Key, Due Date, Summary, External Document, and Internal Document.

**Can I combine some of this content into the same column of the table?** Specifically, I want the results for External Documents and Internal Documents to show in just one column and not have two separate columns.

In other words...So for each row, Key, Due Date, and Summary results would show in the first three separate columns, but the fourth column would include both External and Internal documents combined in one cell.


Answers:
author: Ste Wright
body: Hi [@Laurie Huth](/t5/user/viewprofilepage/user-id/4825705)

Not natively, using that macro.

You could...

* Create an actual Confluence table
* Create multiple Jira Issue/Filter macros - across the relevant columns
* Set each to show just one field from the search, whichever field is relevant to each column

...but it's not an ideal option.

The alternative is to find an App with more powerful table editing/layout options - such as [Table Filter and Charts for Confluence](https://marketplace.atlassian.com/apps/27447/table-filter-and-charts-for-confluence?hosting=cloud&tab=overview) - and test if this allows you to do as needed!

Ste

comments: author: Katerina Kovriga {Stiltsoft}
body: Hi [@Laurie Huth](/t5/user/viewprofilepage/user-id/4825705) ,

Our [Table Filter and Charts for Confluence](https://marketplace.atlassian.com/apps/27447/table-filter-and-charts-for-confluence?tab=overview&hosting=cloud&utm_source=atl_community&utm_medium=answer&utm_campaign=table-filter-traffic-sources&utm_vendorID=1216111) app that was kindly mentioned by [@Ste Wright](/t5/user/viewprofilepage/user-id/1166470) may indeed help your case.

Wrap your Jira Issues macro in the [Table Transformer](https://docs.stiltsoft.com/display/public/TFAC/How+to+use+Table+Transformer+macro?utm_source=atl_community&utm_medium=answer&utm_campaign=table-filter-traffic-sources&utm_vendorID=1216111) macro:

![Mon 3-1.png](https://community.atlassian.com/t5/image/serverpage/image-id/189118iD62A84D16381DFC0/image-size/large?v=v2&px=999 "Mon 3-1.png")

On the screenshot I use a manually created table, but this is only for a more clear example - the Jira Issues macro' output is fully supported by the app.

Then use a simple SQL query where you list what columns you need to show as they are ("Project" for my example) and merge the required columns ("Column 1" and "Column 2" for the case):

SELECT 'Project',  
FORMATWIKI(SUM('Column 1' + "\\n" + 'Column 2')) AS 'Column 3'  
FROM T\*  
GROUP BY 'Project'

And here is the result:

![Mon 3-2.png](https://community.atlassian.com/t5/image/serverpage/image-id/189119i1770F8FB184EFBF0/image-size/large?v=v2&px=999 "Mon 3-2.png")

Hope this helps your case.


author: Laurie Huth
body: OMG. You two are the best!!!! It works. I am so happy you found a solution. Thank you, thank you!!!

One more question though... Going back to Katerina's example, if Column 1 and Column 2 have data in them, it merges beautifully (using the SQL that was provided).

FORMATWIKI(SUM('Column 1' + "\\n" + 'Column 2')) AS 'Column 3'

However, if Column 1 or Column 2 is blank, then the merge is completely blank as well. How do I at least show the partial data? For example, what if Column 1 has info, but Column 2 doesn't? I still want the new, Column 3 to show the info from Column 1?


author: Katerina Kovriga {Stiltsoft}
body: Hi [@Laurie Huth](/t5/user/viewprofilepage/user-id/4825705) ,

Try to modify your SQL query in the following way:

![Tue 4-2.png](https://community.atlassian.com/t5/image/serverpage/image-id/189282i7C4E039B994DE769/image-size/large?v=v2&px=999 "Tue 4-2.png")

SELECT 'Project',  
FORMATWIKI(SUM('Column 1' + "\\n" + 'Column 2')) AS 'Column 3'  
FROM (  
SELECT \*,  
CASE  
WHEN 'Column 1' IS NULL  
THEN "No External Documents"  
ELSE 'Column 1'  
END  
AS 'Column 1',  
CASE  
WHEN 'Column 2' IS NULL  
THEN "No Internal Documents"  
ELSE 'Column 2'  
END  
AS 'Column 2'  
FROM T\*)  
GROUP BY 'Project'

![Tue 4-1.png](https://community.atlassian.com/t5/image/serverpage/image-id/189283iCE1FAD719496BD30/image-size/large?v=v2&px=999 "Tue 4-1.png")

Here we fill the blank cells and then merge the two columns. Hope it works for you.


author: Laurie Huth
body: That worked! Thank you, thank you!


Tags: cloud

confluence-cloud