cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
techtudoor
Resolver I
Resolver I

show email address from multi-select person field in textbox

I have an PowerApps that has a multi-person control. This control pulls from CDS. I am trying to show all the usernames from this field to a multiline textbox in the same PowerApps. So the multi-select person control shows DisplayName. It may have up to 10 names. What I would like to do is show each username in the multiline textbox so that data can be entered for each user: (username1 - did something. username2 - did something else.)

This would allow for the person filling out the form to enter the names once, then in the textbox enter the contributions for each user to the task. I have the following syntax in the multiline textbox:

 

Concat(Split(DataCardValue24.Selected.Email, "@").Result, Result &Char(10))

 

This shows the last username in the  list and the their domain on the second line. I seem to be so close, just can not close the loop, so to speak.

 

Any suggestion would be greatly appreciated.

 

Thanks

1 ACCEPTED SOLUTION

Accepted Solutions
RandyHayes
Super User
Super User

@techtudoor 

Please consider changing your Formula to the following:

Concat(
    Filter(
        ForAll(DataCardValue24.SelectedItems,
            Match(Email, "^\w+[^@]").FullMatch
        ),
        !IsBlank(Value)
    ),
    Value & Char(10)
)

 

I hope this is helpful for you.

_____________________________________________________________________________________
Digging it? - Click on the Thumbs Up below. Solved your problem? - Click on Accept as Solution below. Others seeking the same answers will be happy you did.
Check out my PowerApps Videos too! And, follow me on Twitter @RandyHayes

Really want to show your appreciation? Buy Me A Cup Of Coffee!

View solution in original post

4 REPLIES 4
RandyHayes
Super User
Super User

@techtudoor 

Please consider changing your Formula to the following:

Concat(
    Filter(
        ForAll(DataCardValue24.SelectedItems,
            Match(Email, "^\w+[^@]").FullMatch
        ),
        !IsBlank(Value)
    ),
    Value & Char(10)
)

 

I hope this is helpful for you.

_____________________________________________________________________________________
Digging it? - Click on the Thumbs Up below. Solved your problem? - Click on Accept as Solution below. Others seeking the same answers will be happy you did.
Check out my PowerApps Videos too! And, follow me on Twitter @RandyHayes

Really want to show your appreciation? Buy Me A Cup Of Coffee!

View solution in original post

@RandyHayes , that works great. On an attempt I did get those characters in the Match, I just wasn't sure what they were. I take it those are reference to email formatting. I greatly appreciate this. I was going down an endless rabbit hole using First(Split(Last(Split and other functions that would get me some output, just not what I was expecting.

 

Thank you so much

RandyHayes
Super User
Super User

@techtudoor 

You could have used the split process, but you'd have to wrap it with a bunch of other things to get it to work...so...go simple!

 

The Match function uses regular expression syntax to match and return results.

That expression:  ^\w*[^@]

Says this....match starting at the beginning of the text ^\w*[^@]

Match any regular word character zero or more times:  ^\w*[^@]

Until you find an @ sign ^\w*[^@] 

But, don't include the @ in the result ^\w*[^@]

Then the FullMatch property of Match will have that match in it.

 

 

Extra bonus...to have done it with the Split:

Concat(
    Filter(
        ForAll(DataCardValue24.SelectedItems,
            First(Split(Email, "@")).Result
        ),
        !IsBlank(Value)
    ),
    Value & Char(10)
)

Kind of the same thing, essentially as the regular expression - I just tend to levitate toward a regular expression when dealing with strings.

Not that you would have had it in this case, but IF for some reason an item did NOT have an @ in it.  The Split would have still returned something...which would potentially not have been what you want, whereas the Match would not have matched and been empty and excluded - which would have been more desirable.

 

_____________________________________________________________________________________
Digging it? - Click on the Thumbs Up below. Solved your problem? - Click on Accept as Solution below. Others seeking the same answers will be happy you did.
Check out my PowerApps Videos too! And, follow me on Twitter @RandyHayes

Really want to show your appreciation? Buy Me A Cup Of Coffee!

@RandyHayes 

 

Thank you for the explanation. Now I understand why I was receiving  those characters. I really appreciate it. I should have looked closer when I got those results. This is definitely a syntax that I will be using more and more.

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!

Welcome Super Users.jpg

Super User Season 2

Congratulations, the new Super User Season 2 for 2021 has started!

Carousel 2021 Release Wave 2 Plan 768x460.jpg

2021 Release Wave 2 Plan

Power Platform release plan for the 2021 release wave 2 describes all new features releasing from October 2021 through March 2022.

Users online (1,314)