0

I read about just copying from library to library - this isn't the case.

I have one list and two libraries - the list is called Projects, one is named Documentation, and the third is the Documentation Templates.

The workflow I'm preparing is bound to a list of Projects - during creation, I want to create a 'base' document linked to this project. This document should use a specific template (some doc file) from Templates library.

I cannot simply use Copy List Item from templates to documents because I want to link it to the project I've just created.

Overall look at setting the variables up

So my main struggle is with setting Path and Name, even if it somehow adds a document, it doesn't copy the document itself, just the name (if I try to open it a dialog appears with error saying the file cannot be read).

This is how I set it

Path and name

Any advices how to proceed? The error message in workflow simply points out that creation failed.

  • When you say 'linked' are you saying you want to add a document to a library that has a reference back to the project list item or you are wanting to attach a document to that list item? – MickB Sep 1 '17 at 13:28
  • The first option. I merely meant there is a lookup field in the Document library that points to specific project ID. – Luntri Sep 1 '17 at 13:55
0

What you want to do is create a content type that inherits from the Document parent content type.

After you create it go to 'Advanced Settings' and enter the url of the document in your template library (ex. http://site/documentlibrary/template.xlsx).

Go to your library setting for your project documents list and enable content types. Add the content type you just created to the library.

Add a lookup column on the document library that points to your project list.

Create a workflow that executes when a list item is created. (Note: I've only been able to get this to work with 2010 workflow). Inside that workflow you are going to add a create item step pointing to your document library. Give the file a name for the 'Path and Name' field. For the 'Content Type ID' field, select the content type you created. Also, set the lookup field to "Current Item:ID".

This will create a 1-m relationship between the list item and the documents associated to that list item. If you want the list item to hold the lookup to the document you will need to create the document first. Then with the output id, update the list item's lookup field.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.