Jump to content
Sign in to follow this  

Script to keep only a single email address in a field

Recommended Posts

john777    0


Am trying to clean up the email field on a filemaker database.  At the moment there are many records that contain more than one email address or an email address and text.

what I want to do is delete everything in the field apart from the first email address

In the vast majority of cases the required email address is the first thing in the field.  So my thinking is that the script would have to read along until it found an "@" symbol and then truncate the text at the next space comma or backward or forward slash as they are generally the methods people have used to separate the email addresses.

Apart from that am struggling - I would be delighted if someone could give me some pointers on this

Share this post

Link to post
Share on other sites
comment    1,392
25 minutes ago, john777 said:

space comma or backward or forward slash as they are generally the methods people have used to separate the email addresses.

Can you provide an exact list of all possible separators - or more precisely, separator strings? A forward slash is a valid e-mail address character, so I presume you mean it was used surrounded by spaces? So this particular separator string would be:
" / "

Edited by comment

Share this post

Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this  

  • Similar Content

    • By KassK
      I have been asked to set up something that will send out email automaticly when the date in the "review date" field is 14 days prior to the current date, can someone help me with a script that would be able to perfom this task? I have also created and email field that will hold the email address.
      thank you
    • By drrehak
      I am using EmailRecipients () , and we have noticed that sometimes duplicate emails are being sent. I had one customer who said they received 10!
      any ideas? My script is:
      Set Variable [ $result ; Value:EmailConnectSMTP("smtp.gmail.com:465";"info@**********.com";"*********";"ssl=1") ]
      If [ $result ≠ 1 ]
      Show Custom Dialog [ Message: EmailLastError & ¶ & "Feedback emails failed! Password most likely wrong. Tell Doc."; Default Button: “OK”, Commit: “Yes” ]
      Go to Layout [ original layout ]
      Exit Script [  ]
      End If
      #send email to foundset
      Go to Record/Request/Page [ First ]
      Loop Set Variable [ $first ; Value:patients::first ]
      Set Variable [ $email; Value:patients::email ]
      Set Variable [ $subject; Value:$first & ", Happy Birthday from Colonial Family Eyecare!" ]
      Set Variable [ $msgCreate ; Value:EmailCreate(  "info@************.com";patients::email  ;$subject ) and EmailSetBody( $$body)
      Set Variable [ $setRecipients ; Value:EmailRecipients($email) ]
      Set Variable [ $sent; Value:EmailSend ]
      If [ $sent ≠ 1 ]
      Show Custom Dialog [ Message: EmailLastError; Default Button: “OK”, Commit: “Yes” ; Button 2: “Cancel” , Commit: “No” ]
      End If
      Go to Record/Request/Page [ Next; Exit after last ]
      End Loop Set Variable [ $disconnect ; Value:EmailDisconnect ]
      If [ $disconnect="ERROR" ]
      Show Custom Dialog [ Message: EmailLastError; Default Button: “OK”, Commit: “Yes” ]
      Exit Script [  ]
      End If
    • By docasar
      I have just downloaded the 360works Email plugin Sample and I am doing some tests to check whether this would solve my problem. I would like to be able to download all emails from my email account into "messages" table and then on each customer record show those emails which are related to that customer via a portal based on a relationship between, but what I can not figure out how to do it is that the portal would show but types of emails those marked as "from" emails and those marketd as "to" emails. So far I have created a relationship between Customers::email  ------- Messages::From and the portal would show all "from" messages. If I would set the relationship as Customers:email ------ Messages:To, the portal shows all "to" messages, but what I am trying to make is a join portal that would show by date both "from" and "to" messages, then I plan to make a Conditional Formating saying that if Customers:email = Messages::From then all text in blue, and all text in green when it is TO.
      Is this something that can be achieved?
      Thanks a lot for any tip,
    • By FileDumb
      Hi everyone,
      I have done some research on this but cannot make headway so any help would be much appreciated!
      I am currently thus:
      • Using FM 13 pro advanced to create a runtime solution for use on Windows 7 PC
      • All well apart from when I go to a script to send an attachment by email... "email client not found" comes up...
      Tried setting the default email client but it doesn't show in default programs in Win 7
      Incidentally this system I created works ok in Mac! (but it won't be used on a Mac so...
      Many thanks in advance,
    • By LelandLong
      I read that the new 3.01 version does not require Java.
      When I run FMPAv16 on my Mac (10.11.6) and use the sample Email database it works just fine and I see nothing related to Java. I had the older v2.12 plugin installed on here and have just updated to v3.01 today.
      When I run FMPAv16 on a different Mac (10.11.6) and install the v3.01 plugin (never had the plugin installed on this machine before today) and run the sample database a Java App runs without any windows, Just visible in the lower right dock and its single menu is titled "Java"
      Any ideas as to this oddity?
      Leland Long

Important Information

By using this site, you agree to our Terms of Use.