Tuesday, March 5, 2013

How to pass a value across Approval Levels and Check First Approver is not same as Second Approver in OOB SharePoint Designer Approval Workflow.

Here in one of my requirement I need to pass a value which is entered in level one of approval task from to second level of approval task form. After a  lot of search I was not able to find anything. This is the way I have done it. I will also demonstrate a way to check first app rover is not same as second. These are the steps that be useful for someone looking for same :

Step 1: We need to take two workflow variable on the completion condition of level 1 approval as shown in the below screen shot :


 Through these condition we can get our required values in workflow variables.(Here ID14743  is any field you want to save in this variable  and Modified By contains name of the first app rover. )


Step 2: Now save these two values in two respective fields, in the Before a task is Assigned Status of level 2 approval (This is the key here if you will update these task fields, it will lead to execution of Workflow. So just set it as shown in below Screen Shot). It is compulsory to create two  Task fields to store these values.



No as we have these values in our Task List fields so we can use them in our Info path form(Which is our Task Form as well). Because Info path form are by default associated with Task List fields.

In the info path form in what ever field we want to show this value we need to bind that field with our  Assigned fields. So they will display data entered at first level of approval. I

Step 3: As we got these values in our Info Path form so we need to edit our second level Task Form using info path form client and use some basic info path modification techniques to get it done.
a) In the Approve button of info path we need to set a rule that current user can not be same as what value is in the FirstApprover field (which we have set in this field before a task is assigned so the first app-rover value is with us already).

 We need to set very same rule in Reassign task or any action in which we want to check that First Approver should not perform this action. Using the value of First Approver Field and with new value entered or current user. There is a very important point here to note that always save and return values in same format as Name or User ID or something.

Hope it help someone. Will attach compare Screen Shot for First/Second Approver later.

No comments:

Post a Comment