I have quite a simple issue that has kept bothering me for a while. I have been searching in google (and here) for a solution but never found one, and I believe I am not the only one. I would like to ask if there is a way to optimize this workflow. My idea is working but doesn't feel robust enough.
I have a Sharepoint-Site with various Budget-Lists from different user groups. Each user group has its seperate user rights (i.e. User Group 1 who is responsible for Budget 1 is not able to have a look at Budget 2 etc.). Nevertheless, the management wants to have an overview of all the Budgets. Thus, I have created a new list that consolidates all the various Budget-lists. This new list has also individual user rights for the management only. All the Lists have exactly the same data-structure.
I have created a workflow that runs when the element is created or edited (see Screenshot). The workflow has a parallel function with two "Run if-actions".
1. If field ID_Consolidated is empty (the item is new), the WF will copy the item created at one of the Budget-Lists to the consolidated list. Wait for changes pending, then query the ID of the copied item from the consolidated list based on values of the current item, and save it to ID_Consolidated.
2. If field ID_Consolidated is not empty (the item is not new), the WF will set varialbe vID_Consolidate to the value saved. Then the WF will delete the corresponding item from the Consolidated list, wait for changes pending, and follows with the logik of 1. again.
This works, but I think I will run to problems if the users are duplicating items in their budget lists (as the query criteria is based on the current item, a identical item would make the system confused). I have also tried using the "Copy to Sharepoint" funktion with the option to update a item if it already exists. This did not work, and simply created a new instance of the item.
I would apreciate the help.
Solved! Go to Solution.
sure, if you identify new item by non-key values it will not be reliable.
there are several ways how to approach it
- use create item action instead of copy item one.
that's a bit more work since you have to map each and every field between lists, but advantage is that create item action returns ID of created item
- create your own key value for each item in source budget lists. I'd suggest to use NewGUID inline function. you can write the GUID from the forms on each source list, or you can update it with workflow before you perform copy, that doesn't matter. the GUID gets copied over to consolidated list automatically and you need not to search for created item at all.
- you can maintian just single (consolidated) budget list and with item level permissions control which group of users is allowed to see which single items.
the biggest advantage is that you have just single source of information (thruth). you avoid incosistencies (did all the changes copied over correctly?, somebody changes a value in consolidated report because s/he needs a 'correct' stats quickly but then doesn't reflect that in source list ...), confusions (did last change coiped over already or not?), etc.
other advantage may be that you have everything on single list and you can easily manage access to different budgets- ie. items (even multiple but not necessarily all budgets) just by adding/removing users to group(s)
thank you for the reply, and sorry for my late response!
I have been also trying to understand the item level permissions, as I believe this is the most efficient solution (as You also wrote). Nevertheless, I have not really figured out how to achieve this. Would I need to create different user groups, and use the workflow to set the permission for each item? This is different from target audience I believe? Could You kindly give me some guidance?
exactly, you have to create user groups and assign responsible people to the groups.
once an item is created, a workflow should be started that sets appropriate perrmision for single groups