cancel
Showing results for 
Search instead for 
Did you mean: 
Workflow Hero

Use a workflow to copy (and rename) a file to another library? Nintex 2013

Jump to solution

I have a template file (Excel) saved in a library and I have an unrelated list containing columns for Request number and title.

Each time a new list item is created, I would like to save a copy of the Excel file in a library on the same site, with the filename in format <Request number> - <title>.xlsx or something similar.

The template and destination library can actually even be the same library if that makes things easier, no big deal.  Eventually this folder will have a bunch of Excel files in it with different filenames.

I was excited about using Document Generation for this, but I'm stuck on Nintex 2013 and do not have access to the Document Generation action.

I've looked into the "Copy item" and "Copy to sharepoint" but that doesn't seem to be what I need, nor does "Query Excel Services".

Any ideas?

Labels: (2)
0 Kudos
Reply
13 Replies
Workflow Hero

Re: Use a workflow to copy (and rename) a file to another library? Nintex 2013

Jump to solution

I think you're going to need to use a web service to accomplish this.  You can look at the CopyIntoItemsLocal method.  You would modify the output url to get the file name you want for the new document.  

Reply
Workflow Hero

Re: Use a workflow to copy (and rename) a file to another library? Nintex 2013

Jump to solution

Thanks Brendan.  I'm new at this, but I think I can get through it with some help.  I've attached screenshots of what I'm entering.  This workflow action is completing, but the file isn't getting copied.

I just tried a test to see if I can get the file to copy over from one library to another.  The SourceUrl variable is basically just the path to the .xlsx file.  The DestUrl variable is a path into a folder that exists and my assumption is that it would keep the same filename.

The workflow details says it's "Completed" but as far as I can see, nothing is getting copied.  I'm sure I'm doing something wrong, but my Google-Fu isn't helping me on this one.

0 Kudos
Reply
Workflow Hero

Re: Use a workflow to copy (and rename) a file to another library? Nintex 2013

Jump to solution

I also tried replacing the SourceUrl with the absolute path to the document and the DestUrl with an absolute path and a test.xlsx filename, which also didn't work (but the workflow completed!).

0 Kudos
Reply
Workflow Hero

Re: Use a workflow to copy (and rename) a file to another library? Nintex 2013

Jump to solution

Try logging the url's when the workflow runs so you can see exactly what is being fed to the action.  Also, have you tried using the "Run Now" within the Call web service action and manually putting in the url's to see if it would work?  

0 Kudos
Reply
Workflow Hero

Re: Use a workflow to copy (and rename) a file to another library? Nintex 2013

Jump to solution

I just built this quick test and it worked.  In taking a second look at your variables, it doesn't look like you are including the name of the file itself.  That is part of the path.  

Workflow

Reply
Workflow Hero

Re: Use a workflow to copy (and rename) a file to another library? Nintex 2013

Jump to solution

Brendan, thanks a ton, your method worked perfectly!

Reply
Workflow Hero

Re: Use a workflow to copy (and rename) a file to another library? Nintex 2013

Jump to solution

0 Kudos
Reply
Workflow Hero

Re: Use a workflow to copy (and rename) a file to another library? Nintex 2013

Jump to solution

Brendan,

I'm going to bring this up because I hope this is a simple question : 

In my build string that is getting stored in variable DestinationUrl, one of the parameters for the url is the title of the item.

The file is copying and getting renamed correctly, however when I try to use DestinationUrl as a link in my task notification to link to the file, any spaces that the user put in the title of the list item is breaking the link.

For instance : for an item with a title of "Test 5555", I have this for my build string

https://sitename/Assessments/Level%200%20-%20{ItemProperty:Title}.xlsx

Store Result in : DestinationUrl

My file that gets copied over has a file name of "Level 0 - Test 5555.xlsx" with spaces and everything, it's fine.

However, when I use the workflow variable "DestinationUrl" as a reference in my task notification, the link breaks when it gets to the space between "Test" and "5555.xlsx" like this:

I tried putting quotes around the URL, which I believe fixes the issue with the spaces in the link, but that breaks the build string and doesn't copy the file over correctly.

Any ideas?

0 Kudos
Reply
Workflow Hero

Re: Use a workflow to copy (and rename) a file to another library? Nintex 2013

Jump to solution

You'll need to format the url to replace the space with %20.  You can use a RegEx action to replace the text.  Use the pattern \s.  Make the DestinationURL the input, then save it back to the same variable. 

0 Kudos
Reply