Forums

Articles
Create
cancel
Showing results for 
Search instead for 
Did you mean: 

Hyperlink retrieved incorrectly while using Formatwiki

emagnun
Contributor
October 17, 2024

Hi, 

Below is my table that prints the data as "17 issues" as a link. I'm trying to get this printed as only numbers. i.e.  just "17" while maintaining the same link address.

tt.jpg
1) I tried REPLACE function and it printed "17" but the links were gone. Is there a workaround here?

2) Then I was trying to use the FORMATWIKI function to retrieve the link info of "High" column, but the link info was incorrectly retrieved. Below is my code for table transformer.

 

SELECT T1.'High'->match("^[0-9]+") AS 'High', FORMATWIKI(T1.'High'->tfView->match("href=([^ >]*)")->1->slice(1, -1)) AS 'Link' FROM T1

 


tt.jpg

2 answers

1 accepted

2 votes
Answer accepted
Stiltsoft support
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
October 17, 2024

Hi @emagnun ,

If you are talking about our Table Filter, Charts & Spreadsheets for Confluence app and its Table Transformer macro, you may visit its list of supported functions - the REPLACE_VIEW function that preserves original formatting may suit you:

SELECT *,
REPLACE_VIEW(T1.'High', " issues", "") AS 'Number without issues'
FROM T*

emagnun
Contributor
October 17, 2024

Awesome. This is exactly what I was looking for.

It is possible to do an OR for this REPLACE VIEW?  Basically, if text contains " issues" or " issue", i want to to replace with "". 

Stiltsoft support
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
October 17, 2024

I don't think so, but you may use two SELECTs:

SELECT *,
REPLACE_VIEW('High', "s", "") AS 'High'
FROM
(SELECT *, REPLACE_VIEW(T1.'High', " issue", "") AS 'High'
FROM T1)

Please note that in the internal SELECT we can refer to column names with and without the T1 prefix (here we work with the original table).

But in the external SELECT we refer to the already modified table, so it is 'High' and not T1.'High'. 

0 votes
emagnun
Contributor
October 17, 2024

original code worked but i have a follow up question

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events