Survey Trigger Condition | User Field = Watch list | Additional rule based on email domain of Watch list users

JR42
Giga Guru

Hello! I have a survey that generates a survey instance to everyone listed in the Watch list of the Project when it is Closed (using the User Field in the Survey Trigger).
I have a new requirement to prevent survey instances from generating for users in the Watch list that have a specific email domain associated with their account.

Does anyone have any advice on how I can prevent the surveys from generating for the Watch list users that have an email address associated with their account that ends in the specified domain?

Here is an example:

1) Users are added to the watch list on a Project with their ServiceNow user account.

2) The Project is set to Closed.

3) A Survey instance is generated for each user listed in the Watch list, unless the email address associated with their ServiceNow account ends in @gmail.com (for example).

 

Thanks!

1 ACCEPTED SOLUTION

Jake Sadler
Kilo Sage

Hi,

 

You could create a before insert business rule on the survey instance table to check the user email address and abort the action if it matches your conditions.

 

Thanks

 

Jake

View solution in original post

6 REPLIES 6

Jake Sadler
Kilo Sage

Hi,

 

You could create a before insert business rule on the survey instance table to check the user email address and abort the action if it matches your conditions.

 

Thanks

 

Jake

Hi Jake, thanks for the tip.  I have no idea what I would script, or how, in that business rule.  Can you help me with an example script, or a link to a doc that would get me through it?

 

Hi,

 

 

No code required.

 

Table:

 

find_real_file.png

 

When to run Conditions:

find_real_file.png

 

Actions:

 

find_real_file.png

 

Thanks

 

Jake

Hi Jake, thank you, this is super helpful!  However, I do not have 'Email' as an option for the conditions under the asmt_assessment_instance table.  Looking at one of the survey instances, there is no email field on the form.  I tried to add it under Configure > Form Layout, and Configure > Form Design, but it was not an available field.  Do you have any thoughts on how I can get the email field added so I can use it in the Business Rule conditions?

P.S. I have an 'Assigned To' field, however, I don't have dot walk on it so that I can dot walk to their email.

Thanks again!

find_real_file.png

find_real_file.png