Help

Re: How to start with the API?

3078 0
cancel
Showing results for 
Search instead for 
Did you mean: 
Michel_Billiau
6 - Interface Innovator
6 - Interface Innovator

Hello everyone,
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 ?
Many thanks…

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.

16 Replies 16
M_k
11 - Venus
11 - Venus

Hi @Michel_Billiau

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.

Mary Kay

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.

Thank you Mary Kay for this quick response !
While waiting for other ideas, I’ll start taking a look a Postman…

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.

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…

Indeed. I was in attendance at XML’99; I am that old. :winking_face:

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?

  1. Setup your view to include the records you want.

  2. Run the custom script to generate the html and save the html in a long text field of a table created for that purpose.

  3. Copy/paste the html to a text file with the .html extension.

  4. 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.

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.

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.

Eric_Goldman1
7 - App Architect
7 - App Architect

Hey @Michel_Billiau,

@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/