How to manage content approval in another list

  • 8 February 2016
  • 8 replies
  • 1 view

Badge +4

Hello Community.

I need to keep two lists in the same site in synchrony.

Therefor I need to prevent people from updating an item in one list while the item is being updated or while a workflow is running.

I thought I could use NW action "Set approval status" but this can only be used with the current item.

The idea was to set the items approval status to "Pending" in both lists as long as the item is being updated or the workflow running on either of both lists.

Any suggestions how to achieve this?

Thanks

Thomas

Additional note: we are still using SP2010 and REST API is not available.


8 replies

Badge +11

Hi Thomas,

for updating the current item, you use: "Set Field Value"

for updating another item on the same site, you use: "Update Item"

for updating another item on another site, you (can) use: "Update Multiple Items"

If nothing works for you, you can always make use of SharePoint web services ("Call web service" action) and the REST api ("Web request" action).

MSDN reference for web services: https://msdn.microsoft.com/en-us/library/office/jj193051.aspx

MSDN reference for REST api: Arbeiten mit Listen und Listenelementen unter Verwendung von REST

Using REST api to set approval status of an item (from Stackexchange): SP 2013 REST API How to get Approval Status for Version History items

Greetings

Philipp

Badge +4

Thank you Philipp.

The replication job is already done by using a mixture of the actions you mentioned.

Now I am looking for a way to handle content approval (moderation).

Neither of the actions you mentioned allow for updating the approval status of an item.

Thanks

Thomas

Userlevel 6
Badge +12

If the intent is to merely disallow edits to items that are either being updated or in a workflow, could you remove permissions from the item?

When an item is a part of a workflow, simple use the Set Permissions action and remove permissions at the beginning and then add them back in just before the workflow ends.

When an item is being updated is a bit trickier as a workflow would have the manually triggered to remove permissions. You could do something along the lines of looking at the Approval Status and if it is 'Pending', remove permissions from the other list. This would require that the user place the item in a 'Pending' status prior to updating the item.

Once changes have been made, the user could set the Approval Status to 'Approved', which would trigger another workflow that would add the permissions back to the corresponding item in the second list.

We use something similar to this for announcements. If it is "Displayed", it is displayed on another list for everyone to read, but can be shutoff by changing it to "Hidden". This allows content owners to keep the documentation they want, but promote and display what they want. The second list is setup so all users have read only access to it, so not a concern about updates.

Badge +11

Hi Thomas,

at the stack exchange example you have the code that does what you want, you just have to wrap it in something you can use with nintex. A custom web service would do the trick if a basic REST call can't be used. Isn't that an option for you?

Cheers

Philipp

Badge +4

Hi Philipp,

sorry I didn't mention we're still using SP2010. No REST API.

But it is a good idea going forward.

Thanks again.

Thomas

Badge +4

It is actually worth considering.

Thank you Jesse.

Userlevel 6
Badge +12

Hello Thomas Olbrich​ -

Were you able to get things working the way you wanted?  Let us know what do decided on and how you did it!

Badge +4

Hello Jesse,

Thanks for asking.

Yes I got thinks working as you suggested by using Web Service Call (_vti_bin/NintexWorkflow/Workflow.asmx) to start a workflow on an item in the other list setting the items permissions to Read Only.

Once the update has been successfully done I use another Web service call and set item permissions back to Contribute again.

I mark your answer as correct.

Reply