Attempting to start workflow using specific column content - issue


Badge +4

Hi all,

I am trying to send an email when a SP 'Choice' column entitled 'Countries Affected' contains 'Test Region APAC' here is the simple workflow:

Capture.JPG

The email is being sent fine when the column contains 'Test Region APAC'

However the email is still being sent although there is nothing in that column or I choose another option e.g. 'Test Region NAM'.

Here are the conditions that I set:

Capture2.JPG

What am I doing wrong?

Thanks for your overview.

John


17 replies

Userlevel 5
Badge +14

do your variables contain what you expect?

try to write them to log before set condition action to see what do you compare exactly

Badge +4

Hi John,

If I understand, you want to send an email when your column contain some information.

But your problem is when you start the workflow only one occurrence of the action is executed (if the column already contain what you want the mail is sended and if not no action are exectued).

So, if you want to wait a changed value on your column and respect what you want it contains.

You must to use the wait for item update action :

180381_pastedImage_0.png

And configure it with :

180382_pastedImage_1.png

And after that you can place your test with the send mail.

I hope it could help you.

Best regards,

Badge +6

Hi John,

I notice that you have the value defined as some sort of reference:

You will need to interrogate what is populating this reference. It would seem to me that, if you are always getting the notification, this Test Region APAC reference is always matching the Countries Affected value. Could I suggest replacing the Reference with just the text "Test Region APAC".

Also be mindful that if you have multiple selections allowed on your choice column, the equals option won't be sufficient as you are effectively dealing with an array of sorts.

Cheers,

Mark

Badge +4

Chandra thanks for looking, I tried this and still not getting the response I need in fact emails have stopped completely

1.JPG

Badge +4

Mark, thanks for replying chaned settings to this and now getting no emails at all

1.JPG

Badge +4

As an update the request is getting slightly more complicated.

1. In the list the user wants to be able to tick a box that refers to a distribution list e.g. 'Test Region APAC' and when the list item is saved it goes to that distribution list.

2. The user also wants to be able to select multiple distribution lists, as an example: Test Region APAC and Test Region NAM and Test Region EMEA there are 80 distribution list options to consider.

3.JPG

it is easy to send one email to one distribution list IF it were to stay the same, but there could be 80 boxes ticked and then 80 different emails will be expected to be sent.

3. I have amended the column title from Countries affected to Distribution List, when the user puts a tick in any (or all) of the boxes the email needs to go to those lists, I can create workflow variables and associate the dl's accordingly but cannot figure how to send the email, I have only configured one email notification.

I am also concerned that if e.g. Germany is ticked and the emails contains all the variables all dl's will get the email intended just for Germany.

An interesting problem

Userlevel 5
Badge +14

how do you map your countries/regions(/DLs?) to a mail addresses/mail distribution lists?

are they those workflow variables?

ie. you have one workflow variable for every single choice option?

and do you set static values to the variables within workflow or do you read/query them from somewhere?

do you fill workflow variable based on selected choices or do fill all the variables regardless of selection?

next, I do not understand your following sentence:

I am also concerned that if e.g. Germany is ticked and the emails contains all the variables all dl's will get the email intended just for Germany.

does that mean that despite you just tick Germany (and nothing else) you still want to send mail to other mails/DLs apart from Germany ones? what are the rules?

Badge +4

Hi Marion, in reply:

1. how do you map your countries/regions(/DLs?) to a mail addresses/mail distribution lists? are they those workflow variables? - Yes

ie. you have one workflow variable for every single choice option? - Yes

2. and do you set static values to the variables within workflow or do you read/query them from somewhere? - Yes static, I would expect to control this with a argument that IF 'x' contains e.g. 'Test APAC Region' then use the according w/f variable to send the email to that d/l in the email notification, but I do not know how to configure the email with all 80 variables.

3. do you fill workflow variable based on selected choices or do fill all the variables regardless of selection - I want to fill w/f variable based on selected choices

 

next, I do not understand your following sentence:

I am also concerned that if e.g. Germany is ticked and the emails contains all the variables all dl's will get the email intended just for Germany.

does that mean that despite you just tick Germany (and nothing else) you still want to send mail to other mails/DLs apart from Germany ones? what are the rules? - No, it means that I do not know how to set up the resultant emails, e.g. Distribution List choice 'Test APAC Region' is ticked, therefore the words 'Test APAC Region' appears in Column Distribution List, I want the email sent to just 'Test APAC Region'  only but if e.g. 'Test APAC Region' and 'Germany' is ticked I want the email to go to just those two - this goes back to how to configure the email, it needs to contain all the w/f variables to be able to select the correct one from when the DL is selected.

Userlevel 5
Badge +14

okay, I see your problems then.

if it's an option for you I would completely changed the design:

1. create a list that will store your country/region to mail mappings. basically you needs just two columns like - "Country_Region" and "Mail_Addresses", but you might find it useful to store there some further details as well.

that way your application will be much more flexible and easier maintanable

2. you might consider as well to change your country/region choice column to a lookup column in sharepoint list and connect it to "Country_Region" column of above created list.

this is just optional, and if you decide not to change it, it will not affect functionality.

however, it brings you advantage of storing definition at one place and keep you out of typo or case-sensitivity problems

the disadvantage is little bit complicated work with multi selection lookups in workflow.

3. then in the workflow you have to go through the options and identify which ones are selected.

for each selected option you will have to query list from step 1 and based on the selection (ie. country/region) identify respective mail address.

depends on how do you need to build your mails I would see two possible options how to manage it further

3a. if you can send the same mail (in term of body, attachments, ...) to all the recipients then you can collect all the mail addresses into a text variable. once you have done that for all checked options, you can proceed to step 4

3b. if you have to send different mails to different recipients you will have to place mail action into this loop directly and configure it according the option you are just working on.

4. if you implemented solution 3a. now you can build your mail action and supply to recipients field the variable with collected mails

hope it makes sense for you.

Badge +4

Hi Marion

I am most grateful for your time in assisting, I will work on this and if I may come back to you if I have any questions? otherwise I will let you know the results asap.

Thank you and kind regards

John

Userlevel 5
Badge +14

no problem.

just raise a detailed question, and if not me, somebody on the forum will definitely pick and answer it.

Badge +4

Frank

Thanks for the email, I am still working on this I have marked the reply from Marion as helpful for now, I will come back to the boards once I have completed or need other assistance, but so far I have not resolved this.

Best regards

John Bethray

Badge +4

Could it be this simple?

Taking Marion's advice I redesigned my list and made the regions and countries into one lookup list with multiple selections.

I then created my workflow variables associating each variable with an email address ( there are 80), for this experiment I created a 'John Bethray' (it could be any name but it must be the same name that appears in the distribution lists/workflow variables that can be chosen) I then associated 'John Bethray' with my email address. I then rebuilt the workflow like so, but it looked to simple:

181039_pastedImage_2.png 

I then created a new variable called 'Current DL selected' then in the Build String section I asked the workflow to look in the column 'Distribution Lists' and add that to Current DL selected.

181041_pastedImage_3.png

In the email notification I added 'Current DL selected' in the To: section

181042_pastedImage_4.png

I then saved and published the workflow

I then added a new test entry into the SP list and selected 'John Bethray' when I got to the Distribution Lists, I guess I held my breath then and clicked save - the email arrived,

I repeated the above and did not select any Distribution Lists - no email.

Is there any reason why this should now not work with potentially up to 80 Distribution Lists selected?

As I said, it seems to good to be true?

Thanks for looking

Happy Easter folks!

John

Badge +4

Further issues encountered:

I have added multiple users now to the testing and getting error messages that the workflow is unable to get the full name or email address of the added users, it is most odd as it still works fine for me, so I added to the workflow a variable to set one of the users email address like so:

181225_pastedImage_0.png

This is the error message I get from the Mail Notification part:

Workflow Details:

 

Detailed history of this workflow.

Action History
ActionStartEndDuration
Send notification to DL's selected29/03/2016 09:02incomplete
Set variable29/03/2016 09:0229/03/2016 09:020 minutes
Find DL selected in the notification29/03/2016 09:0229/03/2016 09:020 minutes

Task History
Workflow Messages
TimeEventMessageOutcome
29/03/2016 09:02Workflow CommentFailed to send notification. Cannot get the full name or e-mail address of user "Xxxx - Xxxx".Error

29/03/2016 09:02

ErrorAn error has occurred in New Workflow.
Userlevel 5
Badge +14

I would point you once again to my following comment https://community.nintex.com/message/35525#comment-35525 since I have feeling you haven't understood/implemented it the way I described it.

there is no need to maintain 80 variables within workflow at all!

rest of your logic is somehow not clear to me.

I've tried to build simplified version of that scenario.

my country region vs. mail addresses lookup list.

an item in my 'main' list with multiselect choice of country/region

workflow overview

single actions

workflow history

Userlevel 5
Badge +14

hard to help since I do not see what you really do in your actions and what you do get from list item.

have you manually edited user to be "Xxxx - Xxxx" or do you really get that value? do you correct user/mail value at all?

Badge +4

Hi Marion,

May I give a huge thanks for assisting with this, I am truly grateful, I am still new to Nintex and learning by the minute, you have steered me in the right direction, I eventually got this all working as required although slightly differently from your post of 29-Mar-2016 14:52.

Explanation

My logic in attempting to use the workflow variables at the beginning was mainly due to the fact that the multiple selection Add/Remove fields in the SharePoint 'New Item' form were too narrow to show the full email address I needed so I attempted to use the abbreviated names created as wfv's as these fitted, since then using jquery I have made these Add/Remove fields wider.

Next

I created  a new column in my Lookup list 'Col 3' therefore: Col 1 = Name of distribution list Col 2 = Abbreviated GAL Name & Col 3 = actual email address. I kept my workflow the same as described in my post of 24-Mar-2016 14:55 my only change was to Lookup Col 3 not Col 2 and it all started to work.

Many thanks for your patience and time taken, another school day ;-).

Regards

John

Reply