in site workflow set item permissions is not working

  • 16 February 2016
  • 18 replies
  • 13 views

Badge +6

After creating the some list items I want to edit the permissions of the list items for that I have created the site workflow based on the choice field I want to edit the permissions for that I have used the query list and foreach action and runif condition based on the choice field within the runif I have added the  set item permission

action after scheduling the workflow I am not able to item level permissions for the list item

177505_pastedImage_0.png


18 replies

Badge +7

Hi,

If you've created the list items in the same workflow you'll need to include a Commit Pending Changes action prior to the Set Item Permissions action.

Jan

Badge +6

List items are not created with the work flow i am running this workflow for the exiting list items as site work flow

Badge +7

When you say you're not able to set permissions, is it reaching the workflow action and throwing an error?

Badge +6

yes it is reaching the workflow its not throwing any error but its not setting the permissions as expected but its working with the list workflow but I want to set the permissions for the existing items of the list that's why I went for the site workflow

Badge +7

Please could you post a screenshot of the set item permissions action configuration?

Thanks

Jan

Badge +6

please see the below screen shot of the set item permissions configuration

177560_pastedImage_0.png

Badge +7

Hi,

Just tried this with custom permissions and it works for me, please can you confirm that you are seeing an entry for the action in workflow history?

177559_pastedImage_0.png

Thanks

Jan

Badge +6

please find the below screen of the workflow

177562_pastedImage_0.png

Badge +7

Hi,

Do you need the loop in the workflow as you're updating the same information each time round, try just calling the set item permissions once and see if that resolves the issue?

Jan

Badge +6

Based on the choice field I have to set the permissions I am having four values for the choice field based on that I am adding the different permissions I am looping through this because its a site work flow and applying this permissions to all the items present in the list

Badge +7

OK, but the configuration you've got in the screenshot means you're updating all items in the Product Definitions list with a Status of Draft every time. You'd only need to do this once.

Jan

Badge +6

I have send you the screen shot for only Draft like that  I am having three more Choice values in the workflow that's why I have used the run if based on the choice field value

Badge +7

Thanks that makes sense. I'm not sure why this is not working for you then, I've tried this out and it does work for me. I'm assuming that the account used to publish the workflow has the necessary access level to change item permissions?

Jan

Badge +6

I am the site collection administrator for that site collection

Badge +7

I think I have a solution for you. Query the list for Draft items and store the ID in a collection, loop through the collection and set permissions on each item.

177563_pastedImage_0.png

177564_pastedImage_1.png

Badge +6

Its worked for me

Badge +6

Thanks JAN but why it didn't worked without filter I have used the Runif condition

Badge +7

Hi,

Not 100% sure but the set item permissions action appears to work only on single items, so bulk updates don't seem to be applied. In my original testing I only had one item in my list so it looked like it was working, but once I added more list items I could see that the permissions were only set on the first item.

Applying the permissions update in a loop seemed to be the way to go so I'm glad it's working for you now.

Jan

Reply