cancel
Showing results for 
Search instead for 
Did you mean: 
Highlighted
Nintex Newbie

Box.com connection - Move a file

Jump to solution

Is there a way to append a file with (2) if a file with the same name already exists? Currently, the 'Move a File' connection for Box.com errors out if a file with the same name exists and the entire workflow ends. 

 

THANKS!

 

Labels: (1)
0 Kudos
Reply
5 Replies
Highlighted
Nintex Employee
Nintex Employee

Re: Box.com connection - Move a file

Jump to solution

@poppy Currently this is not possible, you could have it overwrite but that is really only the current option. You can suggest functionality over on our uservoice(https://nintex.uservoice.com/) 

Reply
Highlighted
Nintex Newbie

Re: Box.com connection - Move a file

Jump to solution

Well... there actually -is- a solution, but its tedious and takes a lot of actions.  I'm currently doing this for all Box movement functions within my workflows, and have made a component workflow just for box file movement.  

 

1) Store the filename as a variable (will will be disecting this later)

2) Set a variable to track how many times you've been through the loop

3) Use "Box - Get Folder Contents" to store a collection of all objects in the target folder. 

4) Begin a loop that will exit once a unique filename has been determined

5) Use "Check if item exists in a collection" to determine if the intended filename is already in the target folder (from step 3)

6) Use "Logic and flow - Branch by condition" to have a separate path for an OK filename vs. a conflicting filename

7) on the OK file name path, simply move the file and exit the loop

8) on the conflicting filename path, break apart the filename into 2 separate variables using Regex.  The base filename should be a regex of \.[^.\\/:*?"<>|\r\n]+$  The file extension should be a regex of [^.]+$

9) create a new filename by adding the filename & "_" & the LoopCounter & the filenameExtension. 

10) end the loop

 

By modifying the filename in step 9, the next time the loop completes the filename will now be named "mytextfile_1.txt" after the first loop if there is already a "mytextfile.txt" in the folder.  It will repeat the loop until a conflict is not present.  

 

 

View solution in original post

Reply
Highlighted
Nintex Newbie

Re: Box.com connection - Move a file

Jump to solution

@Ken_T  Thank you for taking the time to explain your solution. I was able to built it out and will be able to use it! Thanks so much again. 

Reply
Highlighted
Nintex Newbie

Re: Box.com connection - Move a file

Jump to solution
Thanks, Im glad it will help you out!
0 Kudos
Reply
Highlighted
Nintex Newbie

Re: Box.com connection - Move a file

Jump to solution

For anyone that is using a solution similar to what I described above; please be aware that Nintex currently only supports searching through 200 entries in a folder.  if you have more than 200 items (files + subfolders) then the Nintex connector will act as if there are only 200.   This can lead to errors where the WF doesn't realize there is a duplicate file name, but the duplicate is past the Box API's pagination value (200). 

 

I've started a feature request to add support for paginated responses in Connectors.  Feel free to add a vote to that request if you use any methods like I described to loop through contents. 

 

https://nintex.uservoice.com/forums/430063-5-nintex-workflow-cloud/suggestions/40062262-add-support-...

0 Kudos
Reply