Notification recipient based on field value

  • 0
  • 1
  • Question
  • Updated 3 years ago
  • Answered
Hi,

I have a table of instruments that have various user name and email fields against each record and I want to set up a notification that sends to a group of people when certain conditions are met an email notification. I can work out how to send an email notification to a list of users set the same for each record but can not work out how you set the to field to be based on users listed against each record. 

I have attached an example of the format of the information on the record page and how the users need to be selected;

A the email would need to go to Users 1,5,8 


B the email would need to go to Users 2,5,8

C the email need to go to user 3,5,9

etc



Thank you

Photo of James

James

  • 172 Points 100 badge 2x thumb

Posted 3 years ago

  • 0
  • 1
Photo of QuickBasePros_IDS

QuickBasePros_IDS, Champion

  • 4,414 Points 4k badge 2x thumb
You can build a formula-text field which can define the list of email receipients based on your criteria; so you let the formula determine the list of recipients, and then simply trigger your email to the [Recipients of Email] field (open notification) when the record changes and certain criteria are met to fire the email.

So, for example you need a formula that will define the recipients using variables, then within the same formula use IF or Case statements to define which receipients will get emails based on your criteria to define those users.  The formula below first defines the email address (UserToEmail) of a [user] field type when a condition is met in the form of variables.  Then we have the formula that defines which variables are the output of the formula (If statement).  

var text salesPerson=If([Condition1]=true,UserToEmail[SalesUser]);

var text servicePerson=If([Condition2]=true,UserToEmail([ServiceUser]);

var text managerPerson=If([Condition3]=true,UserToEmail([ManagerUser]);

If([Condition]="XYZ" and [OtherCondition]="ABC",

$salesPerson &";"& $servicePerson &";"& $managerPerson,

$salesPerson)

Then your email notification will fire to the formula field based on whatever fields are changing and if/when additional criteria are met.
Photo of James

James

  • 172 Points 100 badge 2x thumb
Hi Laura. i got a error message when I tried to create this and I think this is down to how I have set up some of the info as not clear so have added comments to the original question
Photo of James

James

  • 172 Points 100 badge 2x thumb
For clarity the Fields in the table are not User field type but texts fields that represent a user that will be added to the final app.  These fields are populated from a joined table that look up for example the "sales person" depending on the location in the record on the main table. The type of field they are looking up the value from is a text field.
Photo of QuickBasePros_IDS

QuickBasePros_IDS, Champion

  • 4,414 Points 4k badge 2x thumb
Then you need to remove the UserToEmail() component, and just use the field values that contain the emails.
Photo of James

James

  • 172 Points 100 badge 2x thumb
Thank you now works