Best answer

Struggling with Replacing QR Code URL(.png) with Image in Google Docs via Zapier

  • 16 October 2023
  • 9 replies
  • 160 views

Userlevel 1

Objective: I am trying to automate a process where a new spreadsheet row triggers the creation of a dynamic QR code using QR Tiger, which then leads to the generation of a Google Document from a template. In this Google Doc, it now just comes as a dynamic URL to a QR png. I wish to replace the URL placeholder with the actual QR code image (sourced from the QR code URL).
 

Problem: While I have successfully set up the first three steps of my Zap (New Spreadsheet Row -> Create QR Code -> Create Document from Template), I am struggling with the step where the URL in the Google Document is replaced with the actual QR code image.

I've attempted to use Google Apps Script to detect the URL placeholder and replace it with the QR code image, but I consistently giving me errors. Not sure how to solve this problem any maybe there’s a smarter way.

Here's a brief overview of my Zap:

  1. New Spreadsheet Row in Google Sheets: Trigger.
  2. Create Dynamic QR Code (URL) in QR Tiger: Generates a QR code URL like “https://qrtiger.com/qr/TNL5.png”.
  3. Create Document from Template in Google Docs: Uses a A4-template that has a placeholder for the QR code URL.
  4. POST in Webhooks by Zapier: This is where I'm attempting to trigger the Google Apps Script to replace the URL with the image. (Maybe there’s a smarter and easier way?)

I've confirmed that the placeholder URL is present in the newly created Google Document. Despite various attempts and modifications to the script (written by ChatGPT), I'm unable to make this work.

Would appreciate any guidance, insights, or alternative solutions to achieve this. Thank you in advance!

icon

Best answer by Troy Tessalone 26 October 2023, 03:18

View original

This post has been closed for comments. Please create a new post if you need help or have a question about this topic.

9 replies

Userlevel 1

Bump.

Userlevel 1

Anyone?

Userlevel 1

The impossible question it seems? :)

Hi, i’m responding to let you know that the dev team is already reviewing your concern. I will get back to you within the next 12 hours. 

Userlevel 7
Badge +14

Hi @Matadoren 

Good question.

You can use GSlides instead of GDocs. (Help)

 

 

 

Or you’d need to use GDocs API: https://developers.google.com/docs/api/reference/rest

 

Userlevel 1

Thank you for the reply. But unfortunately Google Presentation doesn’t allow A4 formats as far as I’m aware.

In addition, the code (at least made from ChatGPT4) for GDocs API doesn’t work either to convert .png URL to image in Google doc.

Userlevel 7
Badge +14

@Matadoren 

In GSlides you can specify the page size as part of the page setup.

 

Userlevel 1

Thanks Troy, unfortunately it still just gives me a https://XXX.XX/X.png text instead of the image of the .png..

Are there any additional adjustments I would need to do to my {{QRCode}} tag in the Google Slides Template?

Userlevel 1

Just noticed now that if I set it up as a “create dynamic QR” it works and the URL automatically becomes a URL. But when I just a “Static QR Code” URL it doesn’t work. Any ideas?