locked
workflows - multiple if statements RRS feed

  • Question

  • Good afternoon. I know that you can't easily create multiple if / else  statements in workflows. However, since I have to do this in a workflow, I'd like to at least how best to handle this scenario:

    Criteria

    If a contact's position is Current, Retired or Unavailable

    AND

    if job description is Mgr., Chief Officer or Director (I have only listed three job descriptions...there are actually 15 total),

    then send an email to a specific email address recipient.

    How best to hande the if/else statements for this workflow. THANKS!


    Apps
    • Edited by Bernardina Wednesday, December 8, 2010 7:01 PM revised txt
    Wednesday, December 8, 2010 7:00 PM

Answers

All replies

  • What are the data types for "Position" and "Job Description"?  Picklists and Lookups can provide an implicit "OR" by simply selecting all the desired values in a single condition statement.
    Dave Berry - MVP Dynamics CRM - http:\\crmentropy.blogspot.com Please follow the forum guidelines when inquiring of the dedicated CRM community for assistance.
    Wednesday, December 8, 2010 7:53 PM
    Moderator
  • They are picklists.

    Actually, that is exactly what I did (simply selected all the values in a single condition) but thought it was incorrect. Thank you!


    Apps
    Thursday, December 9, 2010 12:43 PM
  • The SQL equivalent of such a statement format is something like:

    WHERE @ContactPosition IN ("Current", "Retired", "Unavailable") AND @JobDescription IN ("Mgr.", "Chief Officer", "Director")
    

    When you stack multiple values together like that, you're creating an array from which the value is searched, as with my example above.  This is, for all intents and purposes, the "OR" being applied implicitly.  Naturally, however, this style of condition configuration isn't available to other fields besides the Picklist or Lookup, and more complicated sets of Workflow conditions are required.  If you ever find yourself in one of those situations, consider putting the actions you wish to take into a child Workflow, and using a parent Workflow to configure all the many conditions you will need to determine whether or not to call the child Workflow--that can save a bunch of time over duplicating actions within each nested condition group.


    Dave Berry - MVP Dynamics CRM - http:\\crmentropy.blogspot.com Please follow the forum guidelines when inquiring of the dedicated CRM community for assistance.
    Thursday, December 9, 2010 5:08 PM
    Moderator
  • I have a few workflows to create on my list. This info will come in handy...especially your line about putting actions to take into a child workflow; parent workflow to configure all the many conditions to determine whether to call child wkflw. I have yet to try that.

    Thank you


    Apps
    Thursday, December 9, 2010 5:14 PM