i have two lists in sharepoint 2010. one that shows: unique name | highest value | value. second list shows: name | value.

for example: first list shows (at first time): gady | 8 | 8. bob | 7 | 7.

second list shows: gady | 5, gady | 2, gady | 1,

i want to update the value on the first list (in the third column) so it substract the values of the second list from it.

for example after i created the last row of the second list, the first list should be look like this : gady | 8 | 0


the problem is i want to do this calculation every time a row is created or changed in the second list. because if someone only wants to update one of the values of the second list the first list will not be changed correctly (or at all).

i want to avoid mistakes in calculation.

(the senario is: i created the first list. gady | 8 | 8. i created one row in the second list : gady | 5 if i only use workflow on create the first list will be gady | 8 | 3

then i want to change the row i created in the second list to : gady | 7. i will get in the first list gady | 8| -4. but i wanted to see : gady | 8 | 1. )

can i do this in workflow (onchange of the second list) ? how can i do that?

thanks , gadym

migrated from stackoverflow.com Dec 17 '11 at 16:38

This question came from our site for professional and enthusiast programmers.


Create additional template_value column in the second list that will hold a copy of "value" column. (as you named it) - just add 'set field to value' in your current workflow. Then add another workflow that will be triggered after second list is edited. Once you edit item the workflow should:

  • add a temporary value to value in the first list (so we're back to previous value in first list)
  • then substract the values as you do for the original workflow
  • tehn copy the new value to your template column

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy