Forum Discussion

  • >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).



  • 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.
  • 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
  • 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]
    • QuickBaseCoachD's avatar
      QuickBaseCoachD
      Qrew Captain
      When converted to a text value, the multi select field is semi colon delimited.  The formula i suggested above

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


      uses a semi colon to separate out the separate email addresses.  You seem to be trying to use a hyphen.

      The other issue may have to do with the type of email Notification you are using.  If these are email addresses, I believe that you will need to use a Notification of type "Open", and not "Recipient".  So you will need to make a new Notification.





    • nitinbisht's avatar
      nitinbisht
      Qrew Member
      Part(ToText(Fox Employee],2,"- ") 
      this is the formula i am using, i created to different Email formula field but whenever i select the email from dropdown, both Email1 and Email2 is displaying the same value.
  • 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
    • ChuckGrigsby's avatar
      ChuckGrigsby
      Qrew Cadet
      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.
    • RajHelaiya's avatar
      RajHelaiya
      Qrew Captain
      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?