Skip to main content

Objective : I want to automate the download of a document from a view link embedded into a Gmail.

 

So far, I can identify the sender but I cannot isolate the “View link” embedded in a call-to-action button from the mail body.

 

Without automation, clicking on this CTA would open a new webpage in which I would have to click on a “download” button and select the preferred format from a list (ex. pdf, word, text...).

I have already search within the community forum but have not found the right approach to crack this use case.

Many thanks for your help!

Hey @pmderouin ,

 

You can use Code by Zapier to get the link for the email body. You can simply write a Javascript code by using split method and you can extract the value from email body.


Hi @pmderouin what is the action after finding the email? Is it saving the attachment in google drive or dropbox? 


Many thanks @jayeshkumarbhatia and @fiona819 for your responses!

I forgot to mention that I am a non-tech guy so Javascript code is currently out of my set of skills. I was thinking that no-code solution would exist.

Here are additional elements of context:

After finding the email (which I manage to set up), the next step is to find the CTA (named “View” in the mail), and then click on it so a new webpage open. On this new webpage, the step would be to click on “Download”, that would open a pop-up window in which I should click on the file format I prefer (.docx, .pdf) from a “list” and then click on “Export” to find it in my Mac’s Download folder.


Hey there @pmderouin 👋

I just came across your post here and wanted to check how you’re getting on. Were you able to find an alternative solution to using a Javascript in a Code action?

If not, you could potentially use a Formatter action to extract the link. Formatter’s Text action has a Extract URL transform that would be able to pull out a URL from the email. See: Extract data in Zaps > Extract URL for details.

Alternatively if there’s multiple links present and you’d only want one of them to be extracted I’d suggest a Formatter Text > Extract Pattern action. It would allow you to use a regex pattern to more accurately find and extract the URL. You can learn more about how to do that here:


The Zap itself wouldn’t be able to click a download link on the page but perhaps you could use an app like Axiom.ai to do it? I’ve not used it myself but it seems like it would be able to carry out actions on a website, such as clicking a download link or button. 

Hope that helps to get you pointed in the right direction if you’re still stuck. And if you run into any further issues or questions do let us know! 🙂