For this example, I created two lists; Representatives and Sales.
In Representatives, I have a column for the Rep's name, a UniqueID (how you choose to address this part is up to you... I just manually assigned a number), and a Count (or Score) of their Approved Sales. So:
In Sales, I have a column for the Representative, the Approval DD (with just the two relevant options: Approved and Denied), and a column for the Rep's UniqueID (I called it RepID in the Sales List, and again for this example I just keyed them in manually, matching what I set up for the fictional Rep's). A Unique Identifier of some kind is important for this to work properly (especially if any Rep's have the same first and/or last name). So:
- Title (of the Sale)
My workflow is set up as follows:
First, I check the Approval status. If it's not Approved, I do
If it is Approved though, I set a workflow variable to the Rep's current Count in the Representatives List. I created the variable, and called it RepScoreCurrent. To do this, I set up the Action as follows:
Field Data to Retrieve
Data Source: Representatives (List)
Field from source: Count (column)
Return field as: As Integer
Find the List Item
These bottom two conditions are what makes the workflow get the correct number. It will search the Representatives List, and retrieve the Count value from the item where the UniqueID column matches the RepID from the current Sales List item.
- Next, I do the "Do a Calculation" Action, and calculate Variable: RepScoreCurrent plus 1 (Output to Variable: calc). Note, you don't have to create the "calc" variable, as SP will do it for you.
- Finally, I choose the "Update List Item" Action, and set it up as follows:
(skip the middle box for now)
Find the List Item
- Field: UniqueID
- Value: Current Item: RepID
Click the "Add..." button, and choose "Count" as the field, and Workflow Variable "calc" as the Value.
I hope this helps, and here are some screenshots of the whole setup:
Setting variable to current Score
Updating correct Representative's Score