4

I am sure this is something quite simple but I can't seem to figure this out (I am new to SPD and workflows in general). I am building a workflow to notify key individuals of a new item(s) being added to a list in SharePoint. I need SharePoint to email those users depending upon the selected value of an existing drop down selection (called "Department"). This selection is a SharePoint lookup column that refers to the title of an external list (called Departments).

In my workflow I can get SharePoint to simply email someone (or a group) when the item is created...that works just fine. What I need is for SharePoint to email user A if selection A is chosen from the aforementioned lookup column...user B if option B from the lookup column is selected...user C for lookup column C...etc.

Here is an example:
1.User creates a new Item and in the dropdown (lookup column) for Department selects "accounting"
2.The workflow sees that "Department" is equal to "accounting" and it emails Jane Doe

*In this example if the selected department was "Technologies" the workflow would email Jon Smith.

I have attempted to configure the condition as:

If Current Item:Department equals Accounting

| Email Jane Doe

*In this example I have manually typed the word "Accounting" into the value field.

However this does not work as no email is ever sent to Jane. I suspect that does not work because Department is a lookup column in this list but I do not know how to properly configure the associated Lookup for Lookup in the condition and I have tried quite a few combinations to no avail.

  • For some unknown reason the: If Current Item:Department equals Accounting | Email Jane Doe works now... But I cant figure out how to sort out the else statements to have it email other people if the department value is different than "accounting". I have tried making separate [If current Item equals value] statements... I have tried using the Else statement...I even managed a "if else" statement but no arrangement seems to email the assigned user of other departments (like technology). any suggestions? – Logan2847 Jul 13 '14 at 23:43
3

Test1 The List, whose column I will use a Lookup column say Test1 enter image description here

enter image description here

Test2 The List which will use the Test1's country column as lookup column is as follows: enter image description here enter image description here

WorkFlow Now the workflow I have created is associated with Test2

enter image description here enter image description here Now check the condition I have put in the Workflow. I checked Current Item:Coountry2 contains India

Now If I run the workflow in the following list, I will get the following result: enter image description here enter image description here

You can check the since the country2 value I set is India, 'Log1' logged in the workflow logs.

Please let me know if uou have any doubt. Good Luck...

  • I'm Not sure exactly what you man by log the lookup column... Something like: [Log CurrentItem:Department to the workflow history list]? – Logan2847 Jul 13 '14 at 23:33
  • Please check my updated post. – Sudip Ranjan Sil Jul 14 '14 at 8:44
  • I am afraid that I am more confused than ever...I don't understand how Logging can influence the functionality of the lookup column I am trying to reference in the workflow. I have gone into the list that coincides with Cities...that references the Country (in your example) and checked the box next to ID so I have a new column in the list for "Country:ID" like your example...and it was after that I got lost. What am I missing here? – Logan2847 Jul 24 '14 at 19:17
  • You can replace the the Log 1 action with your email action. I did not use the Email action there. You can write if logic where you can check Country:ID with certain List Item ID. – Sudip Ranjan Sil Jul 24 '14 at 21:54
2

If I was to make the same setup I would do it like this:

On the lookup list define who should receive the email. Simply add at person group field and add Jane Doe to Accounting, add John Doe to HR and so forth.

(If needed you can turn on content types to let the field be hidden for the users).

In the workflow I'll set a variable "EmailReceiver" to the receiver field in the department list. Matched by the value in the department lookup field (remember to use the lookup-id not the lookup-value).

enter image description here

Now you simply send the mail to the variable "EmailReceiver" rather than hardcode every receiveer in the workflow.

This way you don't have to use a lot of nested if statements and it's a lot easier to maintain as it can be done without entering the workflow :-)

  • Have you tested this out Morten? I have a workflow that uses the same method you have described. I came up with it before reading this post and is pretty identical to your method, however, it does not work. My variables that should contain the email receivers (and also one for a completion percentage) are empty. The w/f lookup process (Find the List Item) cannot seem to locate the correct item in the reference list. Any ideas? – Roger Mellie Jun 2 '16 at 14:29
  • You have created the lookup column? And you are using the Id (NOT the lookup value)? If so please share a bit more information, this should work out for you as well. I've been using this once or twice in the past with no errors. – Morten K Jun 8 '16 at 10:08
1

I ran into the same issue...for some reason the CONTAINS operator is the only one that would work for me. So

If Current Item:Department contains Accounting

| Email Jane Doe

  • I think this is the right answer - which is odd and inconsistent because when applying a list view filter, you HAVE to use "is equal to" on a look up field - "contains" isn't allowed. Typical Msft! – matt Apr 4 '18 at 18:55

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.