AnsweredAssumed Answered

Custom Function Help Need (recursive)

Question asked by fmdataweb on Dec 11, 2016
Latest reply on Dec 11, 2016 by Vaughan

I'm stuck trying to write a custom function that encodes a list of email addresses. I have a list of email address in a field, each one on a new line, like this:

 

bob@hope.com

sally@smith.com

julie@acme.com

 

I need to convert it into this format:

 

"bob@hope.com", "sally@smith.com", "julie@acme.com"

 

where each email address is surrounded by quote marks and has a comma separator between each email address (but not after the last email address).

 

I've created a custom function called ConvertEmails (text) with this formula:

 

Case ( ValueCount ( text ) > 0 ;

"\"" & GetValue ( text ; 1 ) & "\""  &", "& ConvertEmails ( RightWords ( text ; ValueCount ( text ) - 1 ) ) ;

)

 

which currently outputs this:

 

"bob@hope.com", "julie@acme.com",

 

I'm stuck at this point and hope someone more experienced with recursive custom functions can show me what I'm missing here.

 

thanks,

Steve

Outcomes