Dec 15, 2020 04:12 AM
Sometimes I feel the need to print my Airtable table records physically on paper (A4, A5 or even A6), while controlling every formatting and styling aspect (i.e; multiple records on 1 page, formatted as a table X by Y, or a list, controlling the font attributes, the border attributes, rounded corners, background colours,…).
Printing possibilities by default in Airtable are a little to basic. I’m on the Airtable free plan, but even the Page Designer App won’t stretch that far, I guess…
So I think the only way to get it exactly as I want is, is to go through the API, extract the records I need and position them and style them.
But how do I start with the API ? Which tools do I really need ? I read something about airtable.js and also node.js and npm…all very new to me. I’m not afraid to dive in new technology, but I need a starting point. My data in Airtable is mainly personal inventory, like movies, books, games,… There is no need to build a public website, it is only for my personal use.
Anyone who has tried this before and can point me out how to start ?
PS For a good understanding, before I started to use Airtable, I used raw XML files as my data container, then I transformed it with XSLT in to HTML, and with the proper CSS I was able to print it exactly as I wanted it.
I could use the JSON files form Airtable, convert it to XML and continu from there as before, but I don’t think this is the right way. If I want to change this setup I want to do it with the contemporary tools out there in the market and leaving out XML and XSLT.
Dec 15, 2020 04:29 AM
I found this link in the community, although, it seems to be current, I would wait to see what others might post.
How this helps.
Here is another link, I don’t know if this addresses your use case, but I thought I would throw it into the mix.
Here is another link, about Airtable API, see if this is what you are looking for.
The article mentions using Postman (use for testing) , you can find more info on YouTube.
Dec 15, 2020 04:55 AM
Thank you Mary Kay for this quick response !
While waiting for other ideas, I’ll start taking a look a Postman…
Dec 15, 2020 05:00 AM
I would read this as a start. And then take a look at this.
Yes, you could, and that’s not a bad approach except that JSON doesn’t always transform well into XML. I recommend you set the bar a little higher and learn how to transform JSON into HTML/CSS. Your life will be much happier and you’ll be able to leave the less-efficient world of XSLT in the past. I made the same journey and I do not regret the weeks of learning to escape from XSLT.
Yep, these are relatively complex environments to master. I recommend new API programmers take a look at using Google Apps Script for example, this post.
If you want to pursue a no-code solution, take a look at miniExtensions.
Dec 15, 2020 06:02 AM
Thank you Bill for so much information !
I fully agree with you for leaving XML & XSLT behind; although good structure and possibilities, they are technologies from the previous century…
Dec 15, 2020 06:05 AM
Dec 15, 2020 06:41 AM
I think using the rest API for occasional printing is overkill unless you really like coding or need a simple method for other people without access to the base.
For the personal one-off print job, I usually find copy/pasting into Word or Excel, then doing my formatting in Word/Excel to be fairly quick.
For tables that I know I will want to print again with fancy formatting, saving to CSV followed by a mail merge in Word can work well, depending on the type of data.
Since you already have the proper CSS, how about using Scripting app to generate the HTML and use the same CSS?
Setup your view to include the records you want.
Run the custom script to generate the html and save the html in a long text field of a table created for that purpose.
Copy/paste the html to a text file with the .html extension.
Open in your browser and print.
If you want to get a bit fancier, send the html to a service that converts html to pdf. But personal one-off printing usually doesn’t need that much automation.
Airtable Scripting is much easier to learn and use than the rest api. Install the Scripting block and poke around the examples and the documentation. The documentation is quite good.
Dec 15, 2020 07:16 AM
Thank you Kuovonne for these suggestions…
You are absolutely right that using the API for printing purposes is overkill, but that is price I want to pay for have robust solutions and full control. Maybe I regret this overtime :winking_face:
In the past, I tried with conditional formatting in Excel and my experience is that you can have a very quick and easy solution, but it is never what you really want, like rounded corners around the cells, background colours, thumbnails, multicolumn, different page sizes, etc …
Furthermore, the source (i.e. Excel) is still “encrypted” if you compare this to a text readable format.
I like more the idea of scripting, and requires also a bit of coding, but the script block is only available for the free plan until March… so I might lose functionality within a few months, unless I upgrade.
Dec 15, 2020 07:41 AM
If you are printing from the same bases, you can also generate your html for free using formula and rollup fields. It isn’t as robust and flexible as an api solution, but might be easier to code.
But if you want to use the API, by all means, go ahead and learn it. Airtable’s documentation for the API is very good and a great starting point.
Dec 15, 2020 09:42 AM
@kuovonne’s guidance here is great - the API could be a bit of a lift depending on how many records you are dealing with and how you need to filter.
One easy solution could be to pull your data into a tool that makes formatting and visualizing the data easy and printable → like excel or google sheets. The downside is this is relatively manual as the data changes.
Or, you could use a more robust tool like Google Data Studio where you can format and build dynamically. We just built a new tool, Sync Inc, that will allow you to sync your data to a Postgres database that you can then natively connect to GDS.
Then you can make PDFs and print to your hearts content. And this should all be completely free for you.
If this sounds like an interesting path, you can check out Sync Inc to get started → https://syncinc.so/
Dec 15, 2020 10:16 AM
A pro workspace is $20/month or $240 per year. That is a lot of money for some people, especially people with more time than money. On the other hand, sometimes time is money. If you like robust code-based solutions with full control, it might be worth the $240 for the time that you would save in development of both this and other projects. Also, keep in mind that Airtable already extended the deadline for when scripting would become paid once, and they might do it again. (It originally was going to expire back in September, but was pushed out to March.)
You could also try for a Creator Plan as mentioned here and here. I don’t know if this plan exists anymore or if is is possible to request at all, but it provided pro benefits to a workspace with a single collaborator.
Dec 15, 2020 11:00 AM
I’m not sure if the financial outcome is any better, but this post is somewhat relevant to @Eric_Goldman’s comments. I hadn’t considered some of the advantages to using a SQL [following] database until over in that thread, but I suspect Syn Inc might have a free tier making it possible to avoid the scripting block while shaping your data for pretty advanced reporting and all without relearning a lifetime of XSLT. :winking_face:
Dec 16, 2020 01:52 AM
Thank you Eric, Bill for your thoughts on other relational db’s, that might have a better backbone structure for making reports (if I may summarise these thoughts like this).
This might be a solution for sure, but personally, as I’m very happy with Airtable storage for data today, and JSON is the format it supports through the API, on first thoughts, it sounds a bit overkill to bring the data over to a SQL db, only for better formatting and printing.
But as I’m eager to learn, I’ll certainly take a look at this approach :winking_face:
Dec 16, 2020 04:30 AM
Yes, this seems a bit like turning off a light switch with a wrecking ball, but thinking it through I have these observations.
Dec 17, 2020 11:42 PM
Hey @Eric_Goldman, @Bill.French
As I said before I’m eager to learn new things :grinning_face_with_big_eyes: so I gave this a shot.
I have to make a trade off between going further in this direction versus the effort of setting up a JS framework, working with the API, and create the report manually.
Thank you both for sharing your thoughts and opening my eyes in that direction.
Dec 18, 2020 12:42 AM
Any chance PDF MONKEY works for you maybe? Using Integromat you can connect Airtable and Pdf Monkey to generate your data in PDF and style them as you want.
Dec 18, 2020 01:47 AM
I was going to mention Integromat too. It’s a great app and it helps to automate your process.