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
2022 Release Wave 1 760x460.png

2022 Release Wave 1 Plan

Power Platform release plan for the 2022 release wave 1 describes all new features releasing from April 2022 through September 2022.

User Group Leader Meeting January 768x460.png

Calling all User Group Leaders!

Don't miss the User Group Leader meetings on January, 24th & 25th, 2022.

Community Connections 768x460.jpg

Community & How To Videos

Check out the new Power Platform Community Connections gallery!

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