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

Splitting two email addresses

Hi everyone !  

 

Does someone know how to split email adresses with ";" in a textbox? 

Actually I saved the email address that's written, but when I write 2 or more email addresses with ";", it doesn't save into 2 different mails. 

 

Screenshot 2022-04-21 at 10.53.57.png

 

My code is as follow: 

TextBox: 

OnChange = ClearCollect(collectionEmail; txtEmail.Text);;

                      // I tried different codes, it doesn't give an error but doesn't store it as 2 email addresses 

                      Right(txtEmail.Text; Find(";"; txtEmail.Text)) 

                      Concat(Split(Text(txtEmail.Text); ";"); Result) 

                      (Last(FirstN(Split(txtEmail.Text; ";"); 1)).Result)

                      First(Split(txtEmail.Text; ";")).Result

 

Label

Text = If(IsMatch(txtEmail.Text; Email) = false; "Invalid email"; "")

 

Can anyone help me? 

 

 

1 ACCEPTED SOLUTION

Accepted Solutions
alaabitar
Solution Supplier
Solution Supplier

Hello mimii,

 

Can you just try this one please

ClearCollect(collectionEmail,Split(txtEmail.Text,";"))

 

Best regards,

Alaa

View solution in original post

3 REPLIES 3
alaabitar
Solution Supplier
Solution Supplier

Hello mimii,

 

Can you just try this one please

ClearCollect(collectionEmail,Split(txtEmail.Text,";"))

 

Best regards,

Alaa

Hello @alaabitar

 

Thanks for your reply! 

When i'm writing the email addresses, I can now see that they are separated in my combobox. Actually, this works good thank you! 

Screenshot 2022-04-21 at 15.59.27.png

Screenshot 2022-04-21 at 15.59.39.png

 

The only problem that I have now is to save them in SharePoint. I have no idea why this doesn't work anymore. The problem is with EmailAdres in de patch function. Could you help me? 

  

SubmitForm(Form2);;

ForAll(
    collectionEmail;
    Collect(
        colNewItems;
        Patch(
            SharePoint_list1;
            Defaults(SharePoint_list1);
            {
                Title: Text(Form.LastSubmit.'Id (ID)');
                EmailAdres: Text(txtEmail.Text)
            }
        )
    )
)

 

mimii
Helper I
Helper I

I found the solution to save it 🙂 

Helpful resources

Announcements
Power Platform Conf 2022 768x460.jpg

Join us for Microsoft Power Platform Conference

The first Microsoft-sponsored Power Platform Conference is coming in September. 100+ speakers, 150+ sessions, and what's new and next for Power Platform.

Power Platform Call June 2022 768x460.png

Power Platform Community Call

Join us for the next call on June 15, 2022 at 8am PDT.

PA Virtual Workshop Carousel 768x460.png

Register for a Free Workshop

This training provides practical hands-on experience in creating Power Apps solutions in a full-day of instructor-led App creation workshop.

PA.JPG

New Release Planning Portal (Preview)

Check out our new release planning portal, an interactive way to plan and prepare for upcoming features in Power Platform.

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