Skip to main content

I am trying to copy a file in OneDrive from one folder to another and giving it a new name.

My zap trigger is a new record in an Airtable view. This record contains (a) the new file name I want to use and (b) a link to a file on OneDrive, like so: https://adimps-my.sharepoint.com/:u:/g/personal/name_lastname_website_com/Efxw9QkPLmiFs-QHj9veWj2VZLU4EsMbeqpJjyQl-OCwLz?e=8eKqvm

This used to work well for files in Google Drive (using a File ID extracted from the Google Drive URL), but I can’t get anything to work in OneDrive:

  1. If I use the string of characters in the URL as the File ID like I did for Google Drive, I get a correctly named file that is only ~50 bytes and contains only that string of characters as its contents.
  2. If I use the URL to point to the file instead, I get a larger file (a few hundred KB), but its contents are simply a bunch of HTML, and the file size is the same no matter what the input file was.
  3. In all situations, the file extension is not being preserved.

How do I get this zap to work? The name of the file being copied/renamed is not always predictable based on the information in the Airtable record, but the OneDrive link is always known.

Hi @Zap Z. Zapperton 

Help us have more context by posting screenshots with how your Zap steps are outlined and configured in EDIT mode so we can see the field types and field descriptions.


This is the trigger

 

this is the step where I want to rename the file (link under “File”) using the name under “File Name”

 


@Zap Z. Zapperton 

FYI: clicking the link you provided returns an error message, so that may be contributing to your issue when testing.

 

Help article about sending files in Zaps: https://help.zapier.com/hc/en-us/articles/8496288813453

The link needs to be a publicly accessible direct download link.

You can check by copy/paste into a new/different private browser to see if that starts a file download.

 


The link I provided is gibberish, changed from the actual URL to protect company files. 😀 The real URL is accessible but is only accessible to those with folder permissions and to Zapier. It’s not publicly accessible, i.e., to the entire world.


@Zap Z. Zapperton

Did you try this to check access of the link?

You can check by copy/paste into a new/different private browser to see if that starts a file download.

If it does not (e.g. requires a login, etc.), then the link can’t be used for the file.


Turns out that the file can be accessed in a private browser window due to the permissions allowed, so that’s not actually an issue here.


@Zap Z. Zapperton

Did the link initiate a download?

Check if the link is a VIEW link rather than a DOWNLOAD link.

Check if the link redirects at all.


So I figured out a couple things:

  1. I need to first do a Find File in OneDrive step before the Upload File step because I need the file object, not just something that identifies the file. (That’s different from how Google Drive files worked.)
  2. I can search OneDrive using only a partial file name, which is hugely helpful. That way, I don’t need to find a file by using a link to it.

I’m good to go now, other than that I’d prefer to have a view link rather than a download link for the last step of the zap (add a URL for the new file to the Airtable record), but Zapier doesn’t seem to provide that option (just a couple different flavors of download URLs). Good enough for now though.

Thanks for your help!