I am trying to send customised emails to 2 set of users based on the list value input by users. For example, if the user select Japan in the SharePoint form, an email should be sent to Japan users; Similarly if the users select Peru, it should be sent to Peru users.
I have set up the workflow as shown but it is not triggering any email. May I know where did I go wrong? Much appreciate your help!
Solved! Go to Solution.
if you check workflow history of a finished workflow, does it step through any of mail actions?
are you sure 'Country' contains a value resp. expected value?
to investigate, you could enable "Include an other branch" and within the branch send notification with Country value to yourself or write the value to history log.
Thanks for picking up my enquiry and sharing the knowhow. I feel you are right. The Country item in the list is a look up field, drawing from another list. Could this be the reason why it didnt work?
As you have suggested, I have included Other brach and received notificaiton for a coutry (Australia) that is not specified as one of the values for the 'Country'. Is there a way to make the look up field work in this?
Under Set Condition option, there is this option to make the look up item work. However, in Switch Action, this is not available.
yes, lookup is the reason. switch actiononly supports plain text or numeric control value to switch by.
for lookup you will need first need to get lookup text or ID value and store it to a variable. and then configure the switch action to decide by this variable.
Thank you very much. I guess, I can't use Switch funciton then, unless put in a workflow to copy the look up field into another list item and then use it for the Switch.
To copy within the list, do you think any of the workflow function can be used? Anyway, many thanks again for your reply.
...unless put in a workflow to copy the look up field into another list item
no, you don't need to copy anything to another list item, nor to another list field for a current item.
the truth is you cannot use switch action directly on lookup list field. but as mentioned above, you can copy/store lookup list field value into a workflow variable and make switch by that variable.
Thank you for your guidance, one item worked. Basically, I have set the variable to look up list item. Then, In the swtich control, I referred to the variable. Picture as shown below for SGemail. In the form, when I select Singapore, I get the SGemail. However, how do I add the Chinaemail in the switch? As you can see below, only one variable can be selected to match the value in the switch.
Look forward to your guidance. Thanks, Kannan.
I still don't get to run it successfully. Only the Others run for this. Below is how I have set up the Variables (for China and Singapore) and the Swtich value as shown. Appreciate if you can comment, if I am mapping wrongly! Thanks.
once again, to get a lookup field value from an item the workflow is running on, you have to reference 'current item'. so it might look like this
and then use CountryName variable in switch action