Is there is way to read CSV file in confluence user macro? I want to read each column value?

Mohamed Asan
I'm New Here
I'm New Here
Those new to the Atlassian Community have posted less than three times. Give them a warm welcome!
March 29, 2018

Hi All,

I am new to the confluence and working small requirement. I want to read CSV/txt file from local computer and do some manipulation on that read value before displaying confluence page. Is there any way we can do this using User macro or with predefined function?

Your answers will help me lot to meet my deadline. 

Thanks lot,

Mohamed Asan

 

2 answers

1 vote
Katerina Rudkovskaya [Stiltsoft]
Atlassian Partner
May 8, 2020

Hello Mohamed,

There's a new Table from CSV macro you could try in the Table Filter and Charts app. This macro allows you to output a table from CSV or TSV data source on the Confluence page.
By the way, Table from CSV supports outputting data not only from an attached file but also from a URL. And you can use the following data formats: Wiki markup, Markdown, Plain text.

Here's an example of how to use it and manipulate data with the Table Transformer macro then:

1. Add Table from CSV on the Confluence page.

Screenshot_1.pngScreenshot_3.png

Type in the name of the CSV file from Confluence attachments and click insert.

Screenshot_2.png

The table loaded:

Screenshot_4.png


2. Wrap the manually created table and Table from CSV with the Table Transformer macro.


Screenshot_5.png

Choose the preset needed or write your own SQL query.

Screenshot_6.pngScreenshot_7.pngScreenshot_8.png

Using both Table from CSV and Table Transformer you can load a file and manipulate its data.

Katerina
StiltSoft

ofer ROZENBERG March 4, 2021

hi

 

is there a way to configure the csv name dynamically, if for example i use Confiforms    ?

i attach file to form entry and would like that a user will be able to use different file not pre defined in the macro

Alex Medved _ConfiForms_
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
March 4, 2021

Probably you can use ConfiForms ListView to show the data from your form and put the advised macro inside the macro body, in this macro body you can access ConfiForms field values via [entry.field_name] notations that can be passed (and evaluated to values first) to "inner macros"

Alex

Katerina Rudkovskaya [Stiltsoft]
Atlassian Partner
March 15, 2021

Hi @Ofer Rozenman

I am not sure that understood your use case. Could you clarify it, provide more details?

Would you like to have the whole list of attachments available in the Attachment with CSV box right away?

Katerina

0 votes
Anup
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.
March 29, 2018

Why don't you just upload the file to Confluence after you're finished with it?

Mohamed Asan
I'm New Here
I'm New Here
Those new to the Atlassian Community have posted less than three times. Give them a warm welcome!
March 29, 2018

Hi Anup,

The motivation is to automate the process. The file will be created by back end system in CSV format. And need to read to the file and put some extra content and formatting to display into the confluence page.

Thanks,

Mohamed Asan

Anup
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.
March 29, 2018

If you can use a Google sheet for your purpose then you could use a Sheets macro (free add-on available to download) to display it. Any modifications to the sheet would reflect on the Confluence page as it sort of acts like an iframe.

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events