cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
MartynLiv
Helper I
Helper I

Creating an email string variable

I want to create a variable 'EmailList' which holds a string of email addresses. Something like 'MrDog@gmail.com;MissCat@email.com'

 

I have a collection containing a Title column, a TeamLeader column and a RegionalManager column.

 

Title is the name of a Store, such as 'Enfield'

The other 2 columns contain Name and Email. Each of these 2 columns may contain multiple entries.

The collection therefore looks like this:

Title                 TeamLeader                                                                                   RegionalManager

Enfield             Name: Miss C Cat  Email: MissCat@gmail.com                  Name: Mr W Wolf  Email: MrWolf@gmail.com

                        Name: Mr D Dog   Email: MrDog@gmail.com

                        Name: Martyn Burlace Email: MBurlace@gmail.com

 

I would like to get either all TeamLeaders or all RegionalManagers in the email variable.

 

MartynLiv_0-1612461131532.png

MartynLiv_1-1612461340409.png

The code I have used is as follows :

Set(EmailList,Concat(ForAll(AllServices.TeamLeader,Email),Value & ";"));

 

(I haven't yet filtered by Title as I want to get this working first)

 

Result:

MartynLiv_2-1612461761456.png

Any help would be greatly appreciated.

 

Regards,

Martyn

 

 

 

2 REPLIES 2
rubin_boer
Super User
Super User

hi @MartynLiv 

 

Please remove the ForAll from the function and try Set(EmailList,Concat(AllServices,TeamLeader & ";"))

 

 

 

Hi Rubin, thanks for your reply. I tried what you suggested and it came up with an error message. Eventually I settled on this:

 

Set(EmailList,Concat(AllServices.TeamLeader,Email & ";")) (without the ForAll)

 

The AllServices.TeamLeader bit is the table within the collection (AllServices) and Email is an entry within that table.

 

However I'm still getting the same result with the strange email addresses (+@.+\. etc..). When I look in the Collection the email addresses are fine (although some are blank, don't know if this has any bearing on matters).

 

Many Thanks,

Martyn

Helpful resources

Announcements
UG GA Amplification 768x460.png

Launching new user group features

Learn how to create your own user groups today!

Community Connections 768x460.jpg

Community & How To Videos

Check out the new Power Platform Community Connections gallery!

M365 768x460.jpg

Microsoft 365 Collaboration Conference | December 7–9, 2021

Join us, in-person, December 7–9 in Las Vegas, for the largest gathering of the Microsoft community in the world.

Top Solution Authors
Top Kudoed Authors
Users online (2,273)