Dec 09, 2024 09:27 AM
Hello everyone,
I am working on a script where I send invoice data from Airtable to the QR-Invoice API to receive a QR invoice in PDF format. I then want to store this PDF as an attachment in an Airtable table for a specific customer.
My goal is to automate the entire process (sending data, receiving the QR invoice, and saving the PDF as an attachment) within a single Airtable script, without the need for another automation tool like Zapier or Integromat. The process I'm envisioning is as follows:
My question is:
I look forward to any insights or solutions on how to implement this workflow directly in Airtable.
Thank you in advance!
Solved! Go to Solution.
Dec 11, 2024 09:33 AM
I set up the entire automation in Make. Here’s how I solved the problem:
Monitoring new entries in Airtable: The automation starts when a new record is added to the "Rechnungen" (Invoices) table. Make automatically extracts the reference number and the amount from the new entry.
API request to QR-Invoice: These details (reference number and amount) are sent via an HTTP API request to the QR-Invoice service.
Receiving the PDF invoice: I receive the generated invoice as a PDF from the QR-Invoice service.
Converting to Base64: The PDF is converted into a Base64-encoded string using the base64() function, making it suitable for storage as an attachment in Airtable.
Sending back to Airtable: Finally, the Base64-encoded invoice is sent back to Airtable via an HTTP API request and saved directly in the appropriate attachment field of the new record with the attachement endpoints from https://airtable.com/developers/web/api/upload-attachment.
The problem is now successfully solved, and the automation is working perfectly. Thank you for the support!
Dec 09, 2024 11:12 AM - edited Dec 09, 2024 11:16 AM
This will depend on how the API's returns the attachment. If it is a link, you can paste it directly into the attachment field. However if it is a filestream/blob, i believe you'll need zapier/make to manage that.
------------- Edit -------------
Roughly skimming the API docs: https://rest.qr-invoice.cloud/swagger-ui/index.html#/11%20Payment%20Part%20%26%20Receipt%20(QR%20Bil...
It looks like they return files in binary, so this will have to be handled in Zapier: https://www.qr-invoice.ch/angebot/zapier/
Dec 09, 2024 11:22 AM
If you'd like to do all of that in ONE SINGLE WORKFLOW with ONE SINGLE SCRIPT, you can do all of that with ONE SINGLE SCRIPT by using Documint's advanced documents for Airtable, which would also handle the QR code generation for you as well.
Any other way of doing this would require at least 1 script + 1 external automation + 2 external tools. For example, you could use Make's built-in QR Code generation tools, and you could instantly trigger Make with this script, but you would still need to involve a PDF document-generating app (which could be Documint, Google Docs, Microsoft Word, or whatever you want).
Hope this helps! If you’d like to hire an expert Airtable consultant to help you with anything Airtable-related, please feel free to contact me through my website: Airtable consultant — ScottWorld
Dec 09, 2024 06:47 PM
re: Can this entire workflow be achieved entirely within a single Airtable script?
I reckon you could, yeah. Tricky bit is what @sally_andsundry mentioned with the file upload. You'd just need to figure out how to upload the returned pdf into Cloudinary or something so that you could feed that into an attachment field
Could also try using the upload attachment endpoint for this too: https://airtable.com/developers/web/api/upload-attachment
Dec 11, 2024 09:33 AM
I set up the entire automation in Make. Here’s how I solved the problem:
Monitoring new entries in Airtable: The automation starts when a new record is added to the "Rechnungen" (Invoices) table. Make automatically extracts the reference number and the amount from the new entry.
API request to QR-Invoice: These details (reference number and amount) are sent via an HTTP API request to the QR-Invoice service.
Receiving the PDF invoice: I receive the generated invoice as a PDF from the QR-Invoice service.
Converting to Base64: The PDF is converted into a Base64-encoded string using the base64() function, making it suitable for storage as an attachment in Airtable.
Sending back to Airtable: Finally, the Base64-encoded invoice is sent back to Airtable via an HTTP API request and saved directly in the appropriate attachment field of the new record with the attachement endpoints from https://airtable.com/developers/web/api/upload-attachment.
The problem is now successfully solved, and the automation is working perfectly. Thank you for the support!
Dec 11, 2024 04:19 PM
To clarify for those people reading this thread, you used Make's HTTP module to make your API calls.