Help joining tables
Asked by Pete Randall:

I am trying to join the outputs of a Page Properties Report with a Document States Report (I think this is part of the Comala Document Review tools) to combine some headline information for a set of pages with their review status. I previously had these as two tables on the same page, but it is a pain to cross-reference between them so I thought I'd dabble in more advanced Confluencing (being a complete novice).

On my summary page, I have put a Table Transformer object containing two Table Exerpt objects, the first containing the page properties report, and the second containing the Document States Report. The outputs of both these reports always includes a 'Title' column for the page it refers to.

For the Table Transformer, I use the SQL:

```
SELECT * FROM T1 OUTER JOIN T2 ON T1.'Title' = T2.'Title'?
```

When I load the page, I briefly get a pink error box stating "TypeError: Cannot read properties of undefined (reading 'columns'), before what looks like a correct table loads.

Additionally, there seems to be a knock-on effect. My pages being summarised are created from a template, and I had added a button to do this on the summary page. When I now press the button, the process hangs on the template listing panel without showing any templates or progressing to a new blank page.

Am I doing something wrong?

![Atlassian.png](https://community.atlassian.com/t5/image/serverpage/image-id/283669i924B442631C9BB57/image-size/large?v=v2&px=999 "Atlassian.png")


Answers:
author: Katerina Rudkovskaya [Stiltsoft]
body: Hi [@Pete Randall](/t5/user/viewprofilepage/user-id/1213413),  

Please check what version of the Table Filter and Charts for Confluence app you use. The current one is 10.0.0 for Server/Data Center, so if yours is an older one, please ask your Confluence administrator to update it.  

If you are on Cloud and use the old editor (it's more likely you have Server/Data Center, cause I can partly see the version on the screenshot, but for other users who may come across this question), please check if you see the Spreadsheet from Table (not Table Spreadsheet or Table Spreadsheet Include but Spreadsheet from Table) macro in your macro browser. If yes, then you are all good. If no, please ask your Confluence administrator to update the app manually.  

We've recently had a major release, so for Cloud you need to update the app manually just once. After that you'll continue to get all the updates automatically.  

Then check if the issue persists.  

If yes, then you may check where the macro sequence breaks. Your error means that the Table Transformer macro can't see the columns mentioned in the SQL query.  

I mean publish the page only with your Page Properties Report and Document States Report and confirm that you can see everything correctly. Then you may wrap these macros in the Table Excerpts and publish the page again: I see that you checked the "Hide source table" for the second Table Excerpt, uncheck this option -- we don't need it as we have the Table Transformer macro later. So, again you should see two tables.  

Then you may wrap everything in the Table Transformer macro and check that it "sees" your tables: you type in T1. and T2. and wait for the hint. You should see the T1.'Title' and T2.'Title' options.  

What concerns the templates button, I really can't see how it relates to your tables and macros as for now.  

So, if the issue persists after you update the app and check the macro sequence, you may refer to [our support](https://stiltsoft.atlassian.net/servicedesk/customer/portal/14). Attach the page storage format (upper right corner -\> menu ... -\> View Storage Format) of your master page and 2-3 child pages from where you pull your info. We'll be able to recreate exactly your data and macro settings and investigate the issue.  

If you don't see the View Storage Format option in the menu, ask your Confluence administrator to do it for you.

comments: author: Pete Randall
body: Hi Katerina,

thanks for your post. I'm not a Confluence admin (and don't know who is!), but I think the Table Filter \& Charts is v9.12.0 as it shows the version when adding a Table Filter macro to a page.

I suspect we are on server/data centre, based on the URLs involved (they are company-internal, and not in Atlassian domains).

I only see "Table Spreadsheet" in the macro list - no "Spreadhseet from Table". Overall, looks like our plugin needs updating, at least. I can try asking, although don't know how far I'll get with that...

For the other steps - publishing them as individual tables works. But my whole rationale is to avoid the cross referencing between the two tables.

If I untick the "hide source table" then the behaviour is the same, but the display is of two tables. Gradually adding them back in to the Table Transformer macro, the SQL editor does perform the hinting as you describe.

Rather oddly, though, I amended the Table Transformer and instead of specifying the SQL I relied on the built-in "merge" options for the outer join. The SQL is then updated to:

```
SELECT * FROM T1 OUTER JOIN T* ON T1.'Title' = T*.'Title'
```

Which is arguably more generic, but seems to resolve the issue as the table now displays correctly without going through the intermediate pink-error message step.

Slightly confusing as they look syntactically identical for the 2-table scenario.

Button still broken, though, I will try recreating the template...

Many thanks,

Pete


author: Stiltsoft support
body: Hi [@Pete Randall](/t5/user/viewprofilepage/user-id/5329112) ,

Yes, please ask your management to update the app - otherwise your Confluence instance won't get the new macro.

What concerns the updated query and the disappearing mistake, without the page storage we can only guess that the T2.'Title' is a more strict query, so when you update the page there is a millisecond of delay before the Document States Report loads and the Table Transformer macro just doesn't see the second table.

The T\*.'Title' is not a strict query, so the macro checks if there are any tables besides T1 in its body and during this check-up the second table is successfully loading and then merging.

Still no any ideas regarding the button, we use smth similar in our local Confluence and there are no cases that our macros somehow interfere with it.

So, please refer to our support after the app's update - we'll look into the issue.


author: Pete Randall
body: Thanks for the explanation.

Further odd behaviour - I can make a button that works in a child page below the summary page, and equally the "..." button next to "Create" on the Conf page also allows me to select a template to create a new page beneath the child page. But neither of these methods work on the summary page. I may delete all and try again from scratch (at the moment they're only test pages, so no great loss).

Update: Deleting it all and starting the summary page from blank, I can add the button and it works. When I then add the Table transformer that contains two tables - the Page Properties Report and the Document States Report then the Create button ceases to function - specifically it's when the Document States Report is added inside the Table Transformer.


author: Stiltsoft support
body: Can't elaborate more without tests using your page storage format.

Maybe the issue is in the compatibility of the two apps: the Document States Report is not our macro. We support all the standard Confluence macros and try to support other vendors as well but there might be some changes in their apps that we are not aware of.

Please check if everything works well without the Document States Report (try to replace it with a manually created table and check the behavior).


author: Adriana Lamberti
body: Trello me abre los tableros sin el panel izquierdo, o sea sin la lista que tiene opciones como "Unirse", "A?adir Archivos", etc  
Como hago para resolver esto? Borre el cache, habilite cookies, etc (perdon la falta de acentos pero tengo el tablero en ingles para estudiar programacion)  
Desde ya muchas gracias!  
Adriana Lamberti   
aclamberti@hotmail.com  
alamberti677@gmail.com


Tags: filter

table

unknown-hosting-type