Jump to content
Claris Engage 2025 - March 25-26 Austin Texas ×

This topic is 3749 days old. Please don't post here. Open a new topic instead.

Recommended Posts

Posted

it seems that the form of email can't be guaranteed as emails could take the form:

 

User Name<[email protected]>

 

or just

 

[email protected]

 

it would be nice if there was a function that would parse out the single email from the field or a return separated list ( unique or all ) of emails from the message received.

 

i've done it in tandem with script master but in this case client didn't want to deploy a second plugin

 

currently i am left with trying to parse things out, just not elegant or efficient.

Posted

it seems that the form of email can't be guaranteed as emails could take the form:

 

User Name<[email protected]>

 

or just

 

[email protected]

 

it would be nice if there was a function that would parse out the single email from the field or a return separated list ( unique or all ) of emails from the message received.

A custom function taking the parameter i; as input, could look something like this; the basic logic is in place,

---

Case( PatternCount( i; "<" ) = 1 and PatternCount( i; ">" ) = 1;
  Case(
    PatternCount( i; "@" ) = 1;
    Middle ( i; Position ( i; "<"; 0; 1 ) + 1; Position ( i; ">"; 0; 1 ) - Position ( i; "<"; 0; 1 ) - 1 );
    0
  )
) & Case(
  PatternCount( i; "@" ) = 1 and PatternCount( i; "<" ) = 0 and PatternCount( i; ">" ) = 0;
  Trim( i )
)
---
but could be able to abbreviate a bit, this function would go for 1 - one email address,
---
Case( PatternCount( i; "@" ) = 1;
  Case( PatternCount( i; "<" ) = 1 and PatternCount( i; ">" ) = 1;
    Middle ( i; Position ( i; "<"; 0; 1 ) + 1; Position ( i; ">"; 0; 1 ) - Position ( i; "<"; 0; 1 ) - 1 );
    Case( PatternCount( i; "<" ) = 0 and PatternCount( i; ">" ) = 0;
      Trim( i )
    )
  )
)
---
if you would like to have several email addresses parsed in one go, you would have to split by ","
yet FileMaker does not do split and join too nicely hence keeping the addresses on each their record, might be just as nice to work with in FileMaker.

This topic is 3749 days old. Please don't post here. Open a new topic instead.

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
×
×
  • Create New...

Important Information

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