cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
Microsoft BC2me
Microsoft

Verify all substrings are email addresses, if not, add @domainname.com to substring

I have a multi-line text field that may contain multiple email addresses (required becaues SharePoint doesn't do DGs in People Picker).

 

I'd like to split the text up by the ; delimiter between each entry and then check that each contains the FQDN and not just an alias ("alias@microsoft.com" not just "alias").

 

In Javascript, I can use split() to evaluate each grouping by ; (semi-colon) , how do I do this in PowerApps? IsMatch(ThisItem.ItemName,Email) will do an evalutation of the full field/string, but how do I split it apart into substrings?

 

I will then take that substring and if true, pass the value along, if false, add the FQDN to the alias and then pass it along.  

 

Tips on any part or full formala would be appreciated.

2 REPLIES 2
Power Apps Staff CarlosFigueira
Power Apps Staff

Re: Verify all substrings are email addresses, if not, add @domainname.com to substring

Currently there's no way to split a string into multiple values (you can use the functions Find/Left/Right to split one string into two, but not into an arbitrary number of substrings). There's a feature request to add this functionality in the PowerApps Ideas page, please vote it up to get it on the radar of the product team.

Power Apps Staff CarlosFigueira
Power Apps Staff

Re: Verify all substrings are email addresses, if not, add @domainname.com to substring

The latest PowerApps release now has a Split function, which can do this. For example, this expression will tell whether a text input contains only e-mails separated by semicolons.

Concat(Split(TextInput2.Text, ";"), If(IsMatch(Result, Match.Email), "","E")) = ""

While this expression below will add the missing '@domain.com' if the part doesn't have a '@':

Concat(
    Split(TextInput2.Text, ";"),
    If(
        IsBlank(Find("@", Result)),
        Result & "@domain.com",
        Result),
    ";")

 

Helpful resources

Announcements
thirdimage

Power Apps Super User Class of 2020

Check it out!

thirdimage

New Badges

Check it out!

thirdimage

Power Apps Community User Group Member Badge

Fill out a quick form to claim your user group badge now!

sixthImage

Power Platform World Tour

Find out where you can attend!

Power Platform 2019 release wave 2 plan

Power Platform 2019 release wave 2 plan

Features releasing from October 2019 through March 2020

SecondImage

Difinity Conference

The largest Power BI, Power Platform, and Data conference in New Zealand

Top Solution Authors
Top Kudoed Authors
Users online (4,257)