Display CSV file on a page
Asked by Jonathan Abrahams:

I have the following scenario:

* Daily generate a new copy of a CSV file in a cron job
* The CSV file will not always have the same number of rows
* Embed the CSV on a Confluence page, which has other information

Notes:

* The CSV will be generated on a Linux-based system in Python
* Would like to use the REST APIs to update the Confluence page in Python
* Would like to avoid any 3rd party tools or macros

Questions:

* Can I upload the CSV to be stored as content in Confluence, but is not directly viewable?
* Can I just create a Confluence page which references the stored CSV file?


Answers:
author: Mykenna Cepek
body: Seems like you could "upload the CSV as Confluence content" using the Confluence API, specifically with the "content" features:

<https://developer.atlassian.com/cloud/confluence/rest/api-group-content/>

I haven't done it myself, but that's the direction I'd go with this.

Without a Marketplace App, I'm not aware of any built-in features in Confluence Cloud which can reference data in a "stored file". Since Confluence is running in the Cloud, how would it be able to get access to this file? The security aspects alone would be significant.

comments: author: Katerina Kovriga {Stiltsoft}
body: Hi [@Jonathan Abrahams](/t5/user/viewprofilepage/user-id/4977290) ,

Speaking of 3rd party apps I can suggest looking into 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 and its [Table from CSV](https://docs.stiltsoft.com/display/public/TFAC/How+to+use+Table+from+CSV+macro?utm_source=atl_community&utm_medium=answer&utm_campaign=table-filter-traffic-sources&utm_vendorID=1216111) macro.

Maybe our macro will help your case. Besides the add-on is free for Cloud 1-10 users.


author: mdwebber
body: Jonathan - I have a similar problem as you in this question from last year. Did you ever come up with a solution that you can share? I just have to get an existing csv off of a network share onto a Confleunce page. Problem I have is I work for a large Corp and everything is locked down, Admins told me to use a REST and that will do it. Of course no one will tell me what the API secret is etc. A freakin disaster for me. Any loopback you can share (please)? michael w colorado


author: Jonathan G
body: [@Katerina Kovriga {Stiltsoft}](/t5/user/viewprofilepage/user-id/1464746) are you able to update the csv and have it update the file in Confluence, or is it static once uploaded?


author: Stiltsoft support
body: Hi [@Jonathan Grainger](/t5/user/viewprofilepage/user-id/3822548) ,

The Table from CSV macro is dynamic: if you connect it to your Google Spreadsheet and make any changes there or update the page attachment that is reflected through the macro, your result table will be updated as well.

And you may also try the [Table Spreadsheet](https://docs.stiltsoft.com/tfac/cloud/how-to-use-table-spreadsheet-macro-83100938.html?utm_source=atl_community&utm_medium=answer&utm_campaign=table-filter-traffic-sources&utm_vendorID=1216111) macro: you'll be able to upload your existing csv/xlsx file and continue to work with it right in Confluence (cell formulas, filtration, conditional formatting, pivot tables and other Excel-like features are supported).

If required, you may then export your spreadsheet in csv/xlsx formats.


Tags: cloud

confluence-cloud

csv

filter

rest

table