locked
Workflow not executing when conditions met RRS feed

  • Question

  • Hello,

    I am running SP2013 and I have a custom Reusable WF (built in the 2010 style) that works with a content type associated to a forms library. The WF evaluates the Option field on the Form (2 options) if it is Option 1 it is a single approval, if Option 2 it is 2 levels of approval.

    Option 1 triggers the branch of the WF to start Approval process on the submitted form, sends an email to the approver and they approve/reject the item. This works every time, no issues.

    Option 2, start the 1st approval process on the submitted form and IF approved should start approval process 2 on the same item. This is where the WF stops working. I have the condition set to "IF IsItemApproved1 equals Yes" (IsItemApproved1 is the variable in the 1st level approval that I want to trigger to the 2nd level approval). Currently the second step never triggers any approvals. I have created new variables, deleted and recreated the approval process line and nothing(all for the second level approval). 

    Are there any known defects with this type of approval approach in SP13 while making SP2010 version WFs?

    Graphic of WorkFlow

    Any guidance/advice is appreciated


    • Edited by GEE OTTO Monday, October 1, 2018 8:12 PM
    Monday, October 1, 2018 7:05 PM

Answers

  • Hi,

    Please do as the following:

    1. Create a new column named "Is_Approved" Single Line column with default value No and hidden:

    2. Add a update list item option in the OOTB Approval Workflow Completed process like below, set the single text field to Yes

    :

    3. Create the workflow like this:

    The logic is to make sure the first level approval has been approved by checking the column value, then continue the second level approval.

    Result:

    Thanks

    Best Regards


    Please remember to mark the replies as answers if they helped. If you have feedback for TechNet Subscriber Support, contact tnmff@microsoft.com.


    Click here to learn more. Visit the dedicated forum to share, explore and talk to experts about Microsoft Teams.

    • Marked as answer by GEE OTTO Thursday, October 4, 2018 2:45 PM
    Tuesday, October 2, 2018 10:21 AM
  • Hi,

    This is a single line text field directly added in the list/library not need to associate to Content Types. and in Content Types, only set to Hidden.

    In the workflow, we can lookup the field like normal:

    Thanks

    Best Regards


    Please remember to mark the replies as answers if they helped. If you have feedback for TechNet Subscriber Support, contact tnmff@microsoft.com.


    Click here to learn more. Visit the dedicated forum to share, explore and talk to experts about Microsoft Teams.

    Thursday, October 4, 2018 1:33 AM

All replies

  • Hi,

    Please do as the following:

    1. Create a new column named "Is_Approved" Single Line column with default value No and hidden:

    2. Add a update list item option in the OOTB Approval Workflow Completed process like below, set the single text field to Yes

    :

    3. Create the workflow like this:

    The logic is to make sure the first level approval has been approved by checking the column value, then continue the second level approval.

    Result:

    Thanks

    Best Regards


    Please remember to mark the replies as answers if they helped. If you have feedback for TechNet Subscriber Support, contact tnmff@microsoft.com.


    Click here to learn more. Visit the dedicated forum to share, explore and talk to experts about Microsoft Teams.

    • Marked as answer by GEE OTTO Thursday, October 4, 2018 2:45 PM
    Tuesday, October 2, 2018 10:21 AM
  • Thanks for the breakdown and structure advice :) My issue now is that after adding the column and associating it to the Content Type in Library Setting>Content Types I cannot see it in SharePoint Designer. When choosing the If Current Item Field it does no appear. Should I add the field via InfoPath Designer and publish to update the Content Type or add it via SPD? My only option now is to pick Current List then the field is present but it is not a 1:1 lookup as it wants me to further define the lookup which is not correct way to do it.

    Thanks again

    Wednesday, October 3, 2018 8:00 PM
  • Hi,

    This is a single line text field directly added in the list/library not need to associate to Content Types. and in Content Types, only set to Hidden.

    In the workflow, we can lookup the field like normal:

    Thanks

    Best Regards


    Please remember to mark the replies as answers if they helped. If you have feedback for TechNet Subscriber Support, contact tnmff@microsoft.com.


    Click here to learn more. Visit the dedicated forum to share, explore and talk to experts about Microsoft Teams.

    Thursday, October 4, 2018 1:33 AM
  • Alright sorted out the issues I added the field to the form (via InfoPath Designer) in a view that the users cant see Named it FirstLevelApproved and published it to the Form Lib to update the Content Type. I was able to access the field to write the Update line of code. I used your suggestion and simplified the WF slightly (my deployment of SharePoint 2013 is very finicky with these WFs) here is what it looks like and is fully operational:

    I also had went through the OOTB section and deleted the emails e.g. If IsItemDeleted email ContextInitiator that seemed to cause issues. I replaces the Approval Processed with new ones only added the instructions I needed.

    Ultimate goal is to utilize SP13 WFs but that is a whole other post as they are not creator friendly :)

    Thanks for the help!!!!!

    -GeeOtto

    Thursday, October 4, 2018 2:52 PM