locked
help with grouping and/or in Designer workflow RRS feed

  • Question

  • Does Designer have a way to group conditions within a branch in a step?  I can't make mine work.  I want the logic to be:

    If Status = Reinstated and (CollegeID not equals 7 OR CollegeID not equals 12 OR CollegeID not equals 23) and contract = c
    Set category to Contracts

    I have written it like this:

    Else if Status equals Reinstated
    and CollegeID not equals 7
    or CollegeID not equals 12  (I also tried these as AND)
    or CollegeID not equals 23  (I also tried these as AND)
    and contract = c
    Set Category to Contracts

    I actually have a list of about 55 CollegeIDs, of which about 12 are in this "not equals" condition.

    Thank you for any ideas.

     


    There are no mistakes; every result tells you something of value about what you are trying to accomplish.

    Friday, February 7, 2014 1:33 AM

Answers

  • I ended up creating a white list instead and writing it like this:

    If Status=Reinstated
    And contract is equal to c
    And CollegeID is equal to XX||XX||XX||XX

    Set Category to Contracts


    There are no mistakes; every result tells you something of value about what you are trying to accomplish.

    • Marked as answer by run4it Thursday, February 20, 2014 12:05 AM
    Thursday, February 20, 2014 12:05 AM

All replies

  • Hi,

    I think it is not possible to have grouping of conditions, SPD offers only if, else if with multi steps.


    Hope this helps!
    Ram - SharePoint Architect
    Blog - SharePointDeveloper.in

    Please vote or mark your question answered, if the reply helps you

    Friday, February 7, 2014 1:43 AM
  • I'm now trying to use  regular expression.  This seems like it should work, but it is not.  I have very little experience with regex so I may not be writing it correctly.

    Else if Status = Reinstated
    And Contract = c
    And CollegeID matches regular expression [^7|12|23\]


    There are no mistakes; every result tells you something of value about what you are trying to accomplish.

    Friday, February 7, 2014 6:19 PM
  • you can refer here for more information -

    Create compact and powerful conditions in your workflows

    http://blogs.msdn.com/b/sharepointdesigner/archive/2008/05/14/create-compact-and-powerful-conditions-in-your-workflows.aspx?Redirected=true

    you can test / refine your RegEx using some of the online test sites -

    http://regex101.com/

    http://www.myregextester.com/

    http://www.regular-expressions.info/javascriptexample.html


    Hope this helps!
    Ram - SharePoint Architect
    Blog - SharePointDeveloper.in

    Please vote or mark your question answered, if the reply helps you

    Friday, February 7, 2014 7:46 PM
  • I was aware of the msdn blog.  I am still struggling with the regex.  I think I need to move on and just write out the long step of conditional statements.

    There are no mistakes; every result tells you something of value about what you are trying to accomplish.

    Friday, February 7, 2014 9:27 PM
  • Hi run4it,

    How will your workflow not work?

    I tested it if the item CollegeID value is not 7/12/23 using all "AND" operator, it will set the Cagtegory to Contracts, please test again.

    if Status equals Reinstated
    and CollegeID not equals 7
    and CollegeID not equals 12 
    and CollegeID not equals 23 
    and contract = c
    Set Category to Contracts

    Thanks,
    Daniel Yang
    Forum Support
    If you have feedback for TechNet Subscriber Support, contact tnmff@microsoft.com.


    Daniel Yang
    TechNet Community Support

    • Marked as answer by star.warsModerator Tuesday, February 18, 2014 2:56 AM
    • Unmarked as answer by run4it Thursday, February 20, 2014 12:05 AM
    Tuesday, February 11, 2014 8:42 AM
    Moderator
  • I ended up creating a white list instead and writing it like this:

    If Status=Reinstated
    And contract is equal to c
    And CollegeID is equal to XX||XX||XX||XX

    Set Category to Contracts


    There are no mistakes; every result tells you something of value about what you are trying to accomplish.

    • Marked as answer by run4it Thursday, February 20, 2014 12:05 AM
    Thursday, February 20, 2014 12:05 AM