web
You’re offline. This is a read only version of the page.
close
Skip to main content

Notifications

Announcements

Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Apps / Get multiple users dis...
Power Apps
Answered

Get multiple users display name

(0) ShareShare
ReportReport
Posted on by

Hello,

 

While building an app im trying to have a text field with the required attendees of a selected meeting.

It retrieves a string like "xxx@xx.com;xx1@xx.com;". Now what i wanted to be able to do is to pick up that string and split it so it gets each email´s display name using the "useroffice365.userprofile".  This was my best try:

 

split.pngSomehow the mistake it´s point out is that the type of data to split needs to be text, but it actually is! 

 

Thanks for you help,

António Vasques

Categories:
I have the same question (0)
  • MarvinBangert Profile Picture
    1,924 Most Valuable Professional on at

    Hey @Anonymous 

    what kind of data type is your "_selectedCalendarEvent"? Is it a Power Apps collection with different columns and one column is called "RequiredAttendees"? Then the string within RequiredAttendees is a text, but with your code, you don't select the string within the column, you select the column itself which is a table. And you cannot select the text within the column.

    First, you need to get the information from your column "RequiredAttendees" with something like:

    ForAll(_selectedCalendarEvent.requiredAttendees,Split(requiredAttendees,";").Result)

    Then you will have only the results from your "requiredAttendees"-column (because you make a split, the last result is empty). Then you can work on this data. If you have just one record, you can use "First()" to get the value from your result:

    First(ForAll(_selectedCalendarEvent.requiredAttendees,Split(requiredAttendees,";").Result).Value).Value

    Image 660.png 

     

    Hope this will help you! 🙂

     

    Regards

    Marvin

     

    If you like this post, give a Thumbs up. Where it solved your request, Mark it as a Solution to enable other users find it.

  • MarvinBangert Profile Picture
    1,924 Most Valuable Professional on at

    You can also extend it to save all user information within a second collection (i used a button to call this):

    ForAll(Last(ForAll(_selectedCalendarEvent.requiredAttendees,Split(requiredAttendees,";").Result).Value).Value,Collect(userInfo,{Mail: Result,DisplayName: Office365Users.UserProfileV2(Result).displayName}))

     Image 661.png

  • Verified answer
    v-xida-msft Profile Picture
    on at

    Hi @Anonymous ,

    Could you please share a bit more about the data structure of "_selectedCalendarEvent" variable?

     

    Based on the issue that you mentioned, I have made a test on my side, and don't have the issue that you mentioned. The data structure of my _selectedCalendarEvent variable as below:

    6.JPG

     

    7.JPG

    The _selectedCalendarEvent.RequiredAttendees formula would return the following email address:

    8.JPG

     

    If you want to get the corresponding display name based on each email address, please take a try with the following formula:

    9.JPG

    ForAll(
     Filter(Split(_selectedCalendarEvent.RequiredAttendees, ";"), !IsBlank(Result)),
     Office365Users.UserProfileV2(Result).displayName
    )

    Note: You need to add the Office365Users connection in your app firstly

    You could consider add a Data Table in your app, set the Items property to above ForAll formula. Then enable the Value field within the Data Table, then display name list would be listed:

    10.JPG

     

    On your side, please make sure the  _selectedCalendarEvent.RequiredAttendees formula returns a string value rather than a table value or record value. Also please make sure you specify proper Office365Users.UserProfileV2() function within the ForAll function.

     

    Best regards,

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Forum hierarchy changes are complete!

In our never-ending quest to improve we are simplifying the forum hierarchy…

Ajay Kumar Gannamaneni – Community Spotlight

We are honored to recognize Ajay Kumar Gannamaneni as our Community Spotlight for December…

Leaderboard > Power Apps

#1
WarrenBelz Profile Picture

WarrenBelz 711 Most Valuable Professional

#2
Michael E. Gernaey Profile Picture

Michael E. Gernaey 319 Super User 2025 Season 2

#3
Power Platform 1919 Profile Picture

Power Platform 1919 268

Last 30 days Overall leaderboard