I am trying to break then update permissions for each item in a sharepoint list. I am using a component WF to handle this and only able to update successfully if I specifically state in the condition that “ID equals 12345”, but I need it to iterate though out the entire list and update each item.
Best answer by Prineel_V3
@jpacheco if you are trying to loop through every item in your SP list, you do not need any conditions in the “Query a list” action. It will automatically query all the items. However, i see that you are filtering based on the status. So instead of looping through everything and then filtering out the items you want to update permissions on, put those conditions in your “query a list” action. It will return only those items where the condition is met. Then you can loop through all the items from the query’s object and update the permissions using the variables from the first message.
This is what your query a list should look like (feel free to max the item limit if you have a large list):
In the Update Permissions action, your ID and Created by variable, comes from the loop for each tab:
So basically the logic is, for every item (where the statuses match the condition) to have the user who created that item, have read only access. If you use the “First Item> Created by” variable, from the SharePoint Online Object, that will only give the first item’s user, in the collection, “Read Only” permissions to all of the items in the collection (I hope that makes sense). Let me know if you need a better explanation.
So please excuse my ignorance but not sure how to apply your recommendation…
What I am trying to do is look (loop) at every name listed under the Created By column and apply it with the “Update item Permission” control on the last screen shot.
@jpacheco if you are trying to loop through every item in your SP list, you do not need any conditions in the “Query a list” action. It will automatically query all the items. However, i see that you are filtering based on the status. So instead of looping through everything and then filtering out the items you want to update permissions on, put those conditions in your “query a list” action. It will return only those items where the condition is met. Then you can loop through all the items from the query’s object and update the permissions using the variables from the first message.
This is what your query a list should look like (feel free to max the item limit if you have a large list):
In the Update Permissions action, your ID and Created by variable, comes from the loop for each tab:
So basically the logic is, for every item (where the statuses match the condition) to have the user who created that item, have read only access. If you use the “First Item> Created by” variable, from the SharePoint Online Object, that will only give the first item’s user, in the collection, “Read Only” permissions to all of the items in the collection (I hope that makes sense). Let me know if you need a better explanation.
We use 3 different kinds of cookies. You can choose which cookies you want to accept. We need basic cookies to make this site work, therefore these are the minimum you can select. Learn more about our cookies.