How do I sync HubSpot form attachments to Google Drive in HubSpot?

We have a hubspot form from where we collect documents from clients. This documents are then attatched to their records on HubSpot.
We need to upload this documents to Google Drive at a folder with the same name as the record.
I have looked at a solution with Zapier and Integromat/Make, but haven’t been able to figure out the optimal way to do this.
First, because when the files are attatched to a record they become private (correct me if I’m wrong), there is no way to detect them on the contact record with Zapier or Make, so I have to catch the file when is submitted with the form.
With Zapier I have the option to get the public URL of the file, but had troubles creating the Google Drive folder (which might be easy to solve, just bad mapping on my end)
With Make, I couldn’t figure out how to get the public URL, but was able to create the folder on Google Drive with the name submited on the form.
Thing is that whatever I end up using, the folder won’t have the same name as the contact record, because the clients will end up not typing their name on the form exactly as we have it on the hubspot record. We have a lot of clients with similar names, that’s why we need it exactly as the record. Also this solutions might work when client uploads just 1 file, but when multiple files are uploaded at the same time not sure if the Zapier/Make flows would handle all of those or just 1 file.
Appreciate any idea or suggestion that might help me solve this, uploading the file after it was attatched to the record would be ideal because then I could map that record name to the drive folder name.
Thanks.

Moderator Note: this post was reviewed for relevancy and optimized for clarity on 4/13 Thank you for your contributions to the HubSpot Community!

@DanielCS - do you have Ops hub access to custom code workflow steps?

Steve

Yes I have access

So, having just wrestled the files API for uploaded files into submission, I think this would provide you with the all the options and features you want. The tricky bit might be engineering the Google authentication methods.

Probably a fair amount of coding work, but you will get the features you need.

Steve

Thanks, wasn’t aware of the custom code on workflows.
I’m not a coder, so I ended up asking chatgpt for a code (which most probably than not, is incorrect) but mentions that it can send a webhook to zapier or make with the files to then be uploaded to Google drive… if this is correct, will this take care of the google authentication that you mention?

I can’t be sure without trying it, but a webhook to a 3rd party app may not get around the naming issues you mentioned in your original post. If it were me, i’d be trying to implement this without going through Zapier etc. but you may have other constriants.

Steve

Integration Glue has an App that can create a Google Drive folder, among other things. We use this all the time, and their document generator action.

Since this was posted, HubSpot’s Google Drive app added workflow actions that cover most of it without custom code: create a folder named after the record, then upload the file from the form’s file property into that folder. That avoids the private-file problem you ran into with Zapier. If those uploads are sensitive documents, check whether the property is set as sensitive, because those files behave differently.

(Drafted with AI help, reviewed by me.)