Best answer

Rename new dropbox file to have the same name as it's containing folder

  • 4 December 2022
  • 4 replies
  • 162 views

Is there a zap flow that would do the following:

When a new file is added to dropbox, rename the file to have the same name as it’s containing folder.  So each new file should adopt it’s containing folder’s name. For anyone wondering, each folder will already have a unique name so there’s no issue of overwriting.

icon

Best answer by Troy Tessalone 4 December 2022, 17:51

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.

4 replies

Userlevel 7
Badge +14

Hi @kingcapital

Good question.

To detect new files a specific folder has to be specified.

 

But there is an option to rename a file.

 

Yes, but how do you rename the file to be the same name as its parent folder? That’s my question.

Userlevel 7
Badge +14

@kingcapital 

FYI: With the limitation of the Dropbox trigger requiring a Folder be specified to watch for new Files, means a separate Zap would have to be configured for each desired Folder, plus multiple files in a single Dropbox Folder would result in being renamed with the same name.

 

For the renaming, there are 2 approaches.

  1. Static
    1. Since you have to specify 1 Dropbox Folder to watch per Zap, then you could simply add a static value in the Dropbox Rename File step since you already know what the Dropbox Folder name is that you want to use to rename the File to.
  2. Dynamic
    1. From the Dropbox New File in Folder Zap trigger, it will return the file path, that will include the parent Folder.
    2. You can use a Formatter > Text > Split option to parse out the parent folder name.

 

 

Userlevel 4
Badge +7

Hey there @kingcapital, Troy is spot on as always!  Zapier may be able help but not following the path one usually thinks about when building a Zap that does something like this, due to the limitations of the New File trigger.

Another way to think about approaching this - What if there was a single folder in Dropbox you uploaded all of these records to and Zapier both made the folder and then moved and renamed the file to match the folder name?  Thanks to Troy’s screenshot, it looks like we do return the file name individually without the extension so your Zap could look like this:

Dropbox New File trigger => Dropbox Make Folder action => Dropbox Move File action => Dropbox Rename File action 

This would require the file to have the unique name in question which might not at all fit your workflow as it exists presently.  If the file would never be able to know that unique name, the trigger limitation may prevent a great solution in Zapier presently.  However, if one can be flexible with the entire process or workflow prior to data reaching Zapier, we can usually make very robust solutions for novel problems!

Let us know how it goes!