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

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
PowerApps Staff CarlosFigueira
PowerApps 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.

PowerApps Staff CarlosFigueira
PowerApps 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 Automate 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

fifthimage

Microsoft Learn

Learn how to build the business apps that you need.

Top Kudoed Authors
Users Online
Currently online: 132 members 5,127 guests
Please welcome our newest community members: