Can I send emails to values from a multi select text field?

  • 0
  • 1
  • Question
  • Updated 1 month ago
  • In Progress
I want to be able to send emails to records entered or chosen from a multi select text field.
Photo of Raj Helaiya

Raj Helaiya

  • 1,298 Points 1k badge 2x thumb

Posted 2 years ago

  • 0
  • 1
Photo of Chuck Grigsby

Chuck Grigsby

  • 1,978 Points 1k badge 2x thumb
Sounds like you want an email to send which would contain records that were created or edited if certain values were chosen correct? If so you can create a notification in that table. There  you can set for this to trigger on the value change of a field when a record is added or edited. Just have it only send the email when the fields value is the ones you want. 
http://help.quickbase.com/user-assistance/notification.html
Photo of Raj Helaiya

Raj Helaiya

  • 1,298 Points 1k badge 2x thumb
Well, I dont think so that's my use case. I have a names of people in a multi select text field. I want to send email to the person selected from the multi select text field. Can I accomplish this if:
1. I create a separate table with names and email address as fields and then in the properties of the multi select text field choose the values from the created table? 
2. Is it possible in quick base to send emails from values selected from a particular field on a record addition to a table? 
Photo of Chuck Grigsby

Chuck Grigsby

  • 1,978 Points 1k badge 2x thumb
I know you can specify a user field in the email notification setting but haven't tested if you can select a multi-select user field before.
Photo of QuickBaseCoach App Dev./Training

QuickBaseCoach App Dev./Training, Champion

  • 57,114 Points 50k badge 2x thumb
It sounds like Raj os asking how to send emails to whoever was selected in the multi select drop down.

They will first need to be parsed out into separate fields 

so the formula for [email 1] would be
Part(ToText([my multi select field]),1,";")

The formula for [email 2] would be
Part(ToText([my multi select field]),2,";")

The in the Notification you just hand type those fields carefully listed vertically in the box
[email 1]
[email 2]
etc
[email 20]
Photo of Raj Helaiya

Raj Helaiya

  • 1,298 Points 1k badge 2x thumb
Hello, yes you got my question. Can you explain it in a more detailed way to implement this?
Photo of QuickBaseCoach App Dev./Training

QuickBaseCoach App Dev./Training, Champion

  • 57,114 Points 50k badge 2x thumb
I'm not sure what additional detail i can give you.

Make 20 email formula fields as i described above, and then type them into the ox for who gets notified.  Try it for a couple of fields like [email 1] and [email ] and post back if you get stuck. 
Photo of Raj Helaiya

Raj Helaiya

  • 1,298 Points 1k badge 2x thumb
Hello, I tried separating the fields using the formula you suggested. My scenario is:
1. I have just name (text) as values in a multiselect text field.
2. If I stored their email addresses in different fields how would I make sure the name selected from the multi select corresponds to a specific email ? 
Photo of QuickBaseCoach App Dev./Training

QuickBaseCoach App Dev./Training, Champion

  • 57,114 Points 50k badge 2x thumb
Ok, so now its getting more complicated.

First of all, if these are actually users and not outside non-users, then just us a List User field because then you can multi select and also use it in an email Notification.

If these are outside non users, then one low tech solution is to make their dropdown choices in a format where you can directly parse out the email separate from the name. For example

Fred Flintstone - fred.flintstone@bedrock.com
Barney Rubble - barney.rubble@bedrock.com

If you need help with a formula to parse out the email addresses, I can help you with that once you standardize on a format.  Like separating the name form the email address with a hyphen.
Photo of Joshua

Joshua

  • 52 Points
How do I extract out of a text field that reads John Smith - Manager - jsmith@aol.com - 8555551212 the different parts and add them to separate fields. Such as email in one field, phone number in a different field. PS I already did the first part because I had the same situation multi select. So thank u for the first part. and yes these are non users
(Edited)
Photo of QuickBaseCoach App Dev./Training

QuickBaseCoach App Dev./Training, Champion

  • 57,114 Points 50k badge 2x thumb
You can separate the parts of the text field using the Part function and basing it on using the "-" as the separator

then trim to get rid of extra leading and trailing spaces.

For example and formula email field

Trim(Part([my text field], 3, "-"))

That says to get the 3rd part of the text field and then trim it.
Photo of Joshua

Joshua

  • 52 Points
Thank you
Photo of Ⲇanom the ultimate (Dan Diebolt)

Ⲇanom the ultimate (Dan Diebolt), Champion

  • 28,844 Points 20k badge 2x thumb
>How do I extract out of a text field that reads "John Smith - Manager - jsmith@aol.com - 8555551212"

I am not sure how this relates to the original question that mentioned "multi select text field" but it is easy to parse the string you supply and send the parts to individual fields. Here is a demo:


Parse Once ~ Add New Record
https://haversineconsulting.quickbase.com/db/bn7925wrp?a=nwr

Just press the button Parse String and the components will be filled in.

Here is the button definition:
"<a href=# class='Vibrant Success' onclick='[_fid_6.value,_fid_7.value,_fid_8.value,_fid_9.value]=_fid_11.value.split(/ - /);'>Parse String</a>"
Pastie Database
https://haversineconsulting.quickbase.com/db/bgcwm2m4g?a=dr&rid=697

Notes:

(1) This example use a feature in JavaScript called destructuring which can greatly shorten your code. In a nutshell the array returned by splitting on the regular expression / - / is simply slotted into the input fields with fids = 6, 7, 8, and 9:

[_fid_6.value, _fid_7.value, _fid_8.value, _fid_9.value] = _fid_11.value.split(/ - /);

(2) In contract with a formula solution, the parsing of the [String] field is only done once at or near the time of initial data entry.

(3) This technique is quite generic - any string you have in QuickBase can be split into components using regular expressions. As a bonus there have been new features add to JavaScript's regular expression engine that allow parsing of Unicode string and the use of both look-ahead and look-behind patterns (this makes is simple to parse sub-strings within matching quotes, parentheses or even HTML tags).



(Edited)
Photo of Joshua

Joshua

  • 52 Points
Thank you