Using Create Item and Update Document in same workflow. Can it be done?


Badge +4

We send out a newsletter to all our staff on a weekly basis with various amounts of information. Various members of staff update the document over the course of the week before it is distributed on a Thursday. Each newsletter has several 'common' aspects - issue number, date and site.

I've created a site workflow (I think site is the appropriate one) to 'create item' based on a content type (the template for the newsletter) in a newsletter document library and add the issue number to the name. The issue number is taken from a variable and inputted on the start form.

I'm aware on how to use the 'create item' and 'update document' on separate workflows, but can this be done on the same one? I.e can it create an document, and then update the same document? When adding the 'update document' part on the workflow I see the following:

Screenshot

I'm not sure what to put in the Source URL and Output URL.

Additionally, I know there is the functionality for a workflow to create a folder, is there a way for it to create a folder and then create a document (from a content type) within that folder?

Many Thanks!


5 replies

Badge +16

Harry - update document is the one you use when you want to update the content within the document.  is that what you want?  if you want to update just the metadata then you use update item (even though it is a document).  when you create item you can store the ID of the newly created item which you can then use to update the item.

Happy to look at this with you just give me a shout.

Badge +7

Yes, this can be done. You just have to make sure, that you call "save pending changes" after the "create item" and prio to the "update document". Otherwise the batching-feature of nintex will delay the actual creation and thus the document does not yet exists when you try to call the "update document" action.

Badge +4

Hi Both,

Sorry - I need to get better and updating my questions if I figured out an answer.

As I wanted the document name to be something specific I've done with as a variable that is typed in on the start form. I've then used the 'query list' and 'build string' workflow actions to make the URL of the new document and store it as a variable which I then use for the update document action.

This has worked well without any issues - although I imagine there is a quicker/slim-lined way of doing this. Thanks for your suggestion Henning, I can't say I've used the 'save pending changings' action bit will certainly have a look.

Thanks both for taking the time to respond.

Harry

Badge +7

Actually that sound pretty much like the way to go - the tricky part is the fact (as you already figured), that you need the URL of the document for the 'update documet' action.

If you know the title of the document you could build up that name yourself. If you want to be on the "safe side", you should create the item and the retrieve the actual document-url using the query-list action - just like you did.

Badge +4

Hi Henning,

Yes - I did exactly that. Was a bit tricky at first and took a bit of trial and error but used the 'query list' and 'build string' parts to make the URL.

Reply