Table Transformer Macro - Select Column If Exists
Asked by Emily Berg:

Hello!

I am trying to work through an internal issue that has some users seeing certain syntax, while others don't For example, when I pull in the "fixversion" column field, the column name appears (to me) as 'Fix Version(s)'. To others, the column name appears as 'Fix Version/s'.

While our IT department continues to investigate, I would like to propose a workaround - check to see if the column exists in the table. If it does, select it for the output - I would assume this would allow all users to use the same query, while outputting the syntax that is working with their configuration.

So, to recap, I would like to rename columns in my table transformer. And for one column I would like to use the "If Exists" query to check if it's there - and rename accordingly. Another option would be to choose the column based on the index rather than the name (if that's possible).

Thank you!

Emily


Answers:
author: Emily Berg
body: I found a solution, but please advise if you find something different!

IF EXISTS(SELECT T1.'Fix Version(s)' FROM T1)  
SELECT  
T1.'Fix Version(s)' AS 'TER Fix Versions'  
FROM T1  
ELSE  
SELECT  
T1.'Fix Version/s' AS 'TER Fix Versions',  
FROM T1

comments: author: Katerina Kovriga {Stiltsoft}
body: Hi [@Emily Berg](/t5/user/viewprofilepage/user-id/4210574) ,

Please check the version of the Table Filter and Charts for Confluence app - the current one is 7.7.4.

I suppose that the problem is in the browser language settings: some users have American English and some use British English. We had such requests from our customers in the past and improved the Jira Issues macro performance.

So, please, update the app and tell us if the issue is still present.


author: Katerina Kovriga {Stiltsoft}
body: And here is another more simple workaround for similar cases - please check this [abstract](https://docs.stiltsoft.com/display/public/TFAC/Custom+Transformation+-+use+cases+with+advanced+SQL+queries#CustomTransformationusecaseswithadvancedSQLqueries-DefiningJiraIssuefieldsinseverallanguages).

But again we strongly recommend to update the app firstly.


author: Emily Berg
body: Hi [@Katerina Kovriga {Stiltsoft}](/t5/user/viewprofilepage/user-id/1464746) ,

My IT department has stated our current version is 7.1.13 for the Table Filter and Charts for Confluence App. I have inquired about upgrading, but I believe they are hesitant until we can confirm it will not disrupt current production users.

Regarding the language settings, the user experiencing the problems did have English (United Kingdom) as their top preference. She changed it to English (US) and the issue resolved. I assume a more recent version of the app would allow the UK language to be selected?

Thank you for the insight, this is very helpful and eliminates the need to include the "COALESCE" workaround.

Emily


author: Katerina Kovriga {Stiltsoft}
body: Yeah, the Jira Issues macro with different languages was supported in the 7.3.0 version.

And later versions had other useful features like collecting page meta data via the Table Excerpt Include macro (now it can collect page name, creator, created and modified dates, etc.), dependencies for Gantt chart, etc.

It will be better to update the app.


author: Emily Berg
body: Thank you, [@Katerina Kovriga {Stiltsoft}](/t5/user/viewprofilepage/user-id/1464746) .

I will communicate this thread with our IT department.

Emily


author: Katerina Kovriga {Stiltsoft}
body: You may also see all the releases with new features and bug fixes listed on the Marketplace in the Releases section.


Tags: confluence-server

server

table-transformer