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

Web Service UpdateListItems creates .000 files instead of word doc.

Jump to solution

Hi, I would appreciate any help with the following issue. I am trying to create an automated documents creation process using worklfow.

My company has several document templates which I converted into SharePoint content types (created relevant site columns, created template for each CT, inserted Quick Parts controls into it and assigned it to relevant content type).

Then I created the custom list where I configured the columns (same as mentioned content types columns) for the user to fill in one of which being the dropdown - lookup (contains the names of templates=content types and looks up the CT ID and CT columns) in which user can select the template for which he´d like to create the document for. This way when new template is added I just need to create new CT and update the list with corresponding columns as I have done for the existing ones and user will be able to select it and document will be created.

Documents are supposed to be created in document library on the same site which contains mentioned content types.

I then created the workflow (set up to fire when item is created) which uses Web Service call to create selected documents. The reason why am I not using simple create item is that you can´t use variables for Content type and field names with that one and user can select whatever template=Content type which can have whatever fields in it.

Workflow basically does some steps first to get correct SOAP string to use with Web Service UpdateListItems action. The string looks at the end like this (values change based on user input) and it is stored in FinalWebServiceItemCreateStr variable

<Batch OnError="Continue">

<Method ID="1" Cmd="New">

<Field Name='ContentTypeId'>0x010100E89E9E64916F51498E55A40A7F0EDEFE00914168FF378E1A4A844D79D25B29F51A</Field>

<Field Name='LinkFilename'>My Next Order.docx</Field>

<Field Name='UsersNameSurename'>Jan Marek</Field>

<Field Name='WorkPlaceNumber'>876900</Field>

<Field Name='Function'>Purchasing</Field>

<Field Name='KST'>290877</Field>

<Field Name='TelNumber'>800400400</Field>

<Field Name='PCName'>KOPC28905</Field>

<Field Name='ProjectNumber'>I-112233</Field>

<Field Name='ITRequestType'>Standard-Screen</Field>

<Field Name='OrderComment'>OTHER TEST COMMENT</Field>

<Field Name='DevicesType'>New</Field>

<Field Name='OrderRaisedDate'>2017-05-20T22:00:00Z</Field>
</Method>

</Batch>

The web service action is then configured the following way

Web service call err

The workflow runs without error and item is created in mentioned library the content type columns are all filled in correctly with data user entered into the list item. But there is a problem with the item type! It is not a word document! Instead it is the file with .000 extention.

doc type err

I suspect that it is a problem of incorrectly addressing th Name field in the library in the SOAP string.

<Field Name='LinkFilename'>My Next Order.docx</Field>

But I can´t figure out what field to address instead  Or if this is even the root cause of the problem....

Any ideas anyone please?

Many thanx for any sort of answer.

Jan

Labels: (2)
0 Kudos
Reply
6 Replies
paul_crawford
Nintex Newbie

Re: Web Service UpdateListItems creates .000 files instead of word doc.

Jump to solution

Hi

You could use the create item in another site action which then allows you to access the content type field and choose the relevant content type and then set all the fields as required.

0 Kudos
Reply
marekan
Nintex Newbie

Re: Web Service UpdateListItems creates .000 files instead of word doc.

Jump to solution

Hi Paul,

thanx for the answer.

I just cannot imagine how this would work if the selected template (content type) and its fields are not known in advance...

Maybe I am not entirelly clear on what you have in mind here. Could you elaborate on your proposal a bit more please?

Jan

0 Kudos
Reply
marekan
Nintex Newbie

Re: Web Service UpdateListItems creates .000 files instead of word doc.

Jump to solution

One addition, I did some googling around and it looks like that those .000 files are just sort of a back-up version or temporary version of the actual word document that is to be created. Once it is created the .000 file is discarded and SharePoint displays the word doc. to the user.

I think that my workflow doesn´t actually create word document in that library it just somehow goes half way when it fills in all the properties of selected content type but cannot actually create the document itself and that is why it shows only those .000 files.

So, I tried to use CopyIntoItemLocal web service action to actually copy the selected content type´s template from Web Url/LibraryName/Forms/ContentTypeName/template.docx to the Web Url/LibraryName/template.docx to be able to modify it then using UpdateListItems action but the template just isn´t copied by CopyIntoItemLocal web service action (again, no error WF runs fine but the item isn´t really copied and it is not copied and checked out either, I tried to test that one also). So I am kinda lost here...

Just for clarification here is the configuration of CopyIntoItemLocal web service action

So, that´s the story  This would all be so much easier if Nintex just offered data builder in create item action content type selection instead of a dropdown where you have to select the CT manually...

0 Kudos
Reply
paul_crawford
Nintex Newbie

Re: Web Service UpdateListItems creates .000 files instead of word doc.

Jump to solution

hi

I have two possible workarounds

1. Use create item in another site: there will be a set amount of content types in your library. i dont know how, in your process, the decision is made to use a specific content type, but could you set a variable to the selected content type and then have a switch with the content type options in and depending on with content type is chosen the switch will use the create item in another site to create the correct document depending on the content type selected?

2. Something I have done in a document management process is to have a library with the template documents in. The content type settings for the template then use the url of the document in the library so when a new document is created it uses this template. If you have an actual copy of the document in a library then you can use copyintoitemslocal and it would use the same template as if you click the new document option.

Hope this helps and is clear

View solution in original post

Reply
marekan
Nintex Newbie

Re: Web Service UpdateListItems creates .000 files instead of word doc.

Jump to solution

Many thanx Paul!

I solved it using the approach 2. Although it is really strange that you cannot copy the template from Web Url/LibraryName/Forms/ContentTypeName/template.docx location as I have been trying but you can copy those same files if you put them in ordinary library

Anyhow....really appreciated your help!

Reply
paul_crawford
Nintex Newbie

Re: Web Service UpdateListItems creates .000 files instead of word doc.

Jump to solution

Hi

Glad its sorted for you

0 Kudos
Reply