Update listitem workaround - Nintex

October 4, 2022

Business process automation on old versions of SharePoint (2013, 2016) on premises usually done by Nintex Forms and Nintex Workflow. This is a quite good approach although it is very sensitive and sometimes unpredictable. A workflow can run 100 times successfully and then accidentally fail a few times without any obvious reason.

Typical issue

One of the root causes is possibly a lack of retry mechanism, which basically doesn’t exist in most of the cases. Sometimes you just get weird error messages like this one:

or the famous “coercion failed” error. The biggest problem with these if you just restart your workflow, the issue will not come up again without any modification on the item or on the workflow...

For this reason you need to prepare your workflows to be restartable and monitor your workflow error messages to be able to act when this happens.

Monitoring is quite easy, you just need to configure notification address on the SharePoint Central Administration/Nintex Workflow Management/Workflow error notifications

Making the workflow restartable is not always possible. The bare minimum is to avoid using the “Workflow Initiator” value. If your workflow starts on the creation of an item, you can use the “Created by” field value instead. In case of starting at modification of the item, you don’t really have too many options.

Workaround for “update item” failure

The above issue used to come up more frequently when you update or create item in another list. The workflow action “Update item” is buggy even in the designer when you use SharePoint 2013. It cannot be configured in Chrome, just in Internet Explorer (IE mode in Edge).

Luckily SharePoint provides web services out of the box which can be used as a workaround. The List web service ({siteUrl}/_vti_bin/lists.asmx) was introduced in

an earlier version of SharePoint, maybe in 2003 and can be used to query or manipulate list data. It is not a REST API so instead of JSON, it uses XML and the best part is, that Nintex has a “Call web service” action out of the box.

You can update multiple items or just one as well using a simple call. It will give you a chance to manage the errors as well if you would like to.

Use a service (technical) account instead of yours with a password which will not expire and set the account permission properly.

Important part is to use the internal name of the columns within the XML as the name attribute of the Field tag. The internal name can be copied from the URL by

navigating to the List settings and clicking on the column name.

https://{server}/sites/{sitename}/_layouts/15/start.aspx#/_layouts/1 5/FldEdit.aspx?List={list id}&Field={internal name of the column}

Below you can see an example XML to avoid the need for typing.

<?xml version="1.0" encoding="utf-8"?>
<soap:Envelope xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/" xmlns:m="http://schemas.microsoft.com/sharepoint/soap/"> <soap:Header>
</soap:Header>
<soap:Body>
<m:UpdateListItems>
<m:listName>List name</m:listName>
<m:updates>
<Batch>
<Method ID='1' Cmd='Update'>
<Field Name='ID'>ID - some integer</Field>
<Field Name='Internal name of the column1'>value1</Field> <Field Name='Internal name of the column2'>value2</Field> </Method>
</Batch>
</m:updates>
</m:UpdateListItems>
</soap:Body>
</soap:Envelope>
István Kovács
Cloud Architect