Skip to main content

REGEX Combining multiple columns as comma separated

  • November 8, 2024
  • 2 replies
  • 32 views

Forum|alt.badge.img+4

Hi community,

I have a formula to combine emails from multiple columns, that generally contain multiple linked records (but not always).  This REGEX formula works really well for the first 3 columns, but is failing on the final.  Any help on what I'm doing incorrectly would be greatly appreciated!

Goal: string together a list of email addresses from multiple columns, with a "comma" between them, but if a column is black, don't add ",".
 
Current Formula is:
 
REGEX_REPLACE(CONCATENATE(IF({Moderator Email}, {Moderator Email} & ", "), IF({ADM Primary Email}, {ADM Primary Email} & ", "), IF({Other Panelists Email (Primary)}, {Other Panelists Email (Primary)} & ", "), IF({Other Panelists Alternate Email}, {Other Panelists Alternate Email}) ), ", $", "" )
 
For some reason, the last 
{Other Panelists Alternate Email}. is not comma separated.  The result merges all 3 user emails into one long strain......
 

2 replies

Mike_AutomaticN
Forum|alt.badge.img+28

Hey @KFIL!

Please give this updated formula a try:

REGEX_REPLACE( CONCATENATE( IF({Moderator Email}, {Moderator Email} & ", "), IF({ADM Primary Email}, {ADM Primary Email} & ", "), IF({Other Panelists Email (Primary)}, {Other Panelists Email (Primary)} & ", "), IF({Other Panelists Alternate Email}, {Other Panelists Alternate Email} & ", ") ), ", $", "" )


Please let me know if that helps.

Mike, Consultant @ Automatic Nation


Forum|alt.badge.img+4
  • Author
  • New Participant
  • November 9, 2024

Hey @KFIL!

Please give this updated formula a try:

REGEX_REPLACE( CONCATENATE( IF({Moderator Email}, {Moderator Email} & ", "), IF({ADM Primary Email}, {ADM Primary Email} & ", "), IF({Other Panelists Email (Primary)}, {Other Panelists Email (Primary)} & ", "), IF({Other Panelists Alternate Email}, {Other Panelists Alternate Email} & ", ") ), ", $", "" )


Please let me know if that helps.

Mike, Consultant @ Automatic Nation


Thanks!  I may have omitted a ",", but also seeing some interference with a lookup field.  Once I put into an ARRAYJOIN formula, it worked like a charm!  Appreciate the speedy help, @Mike_AutomaticN !!!!