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

Pulling Office365User data from Sharepoint 'Created By'

Hello!

 

I have a collection (colusers) with all distinct users of an app using the 'Created By'.Email Column of a SharePoint list called 'Activity Tracker'. 

 

How can I add columns to this collection, that pulls Office365User data for these users?  I'm interested in being able to add a few of the available Profile fields including Surname, Given Name, Department, jobTitle.

 

I've tried some different variation in a ForAll function.  I think what I'm struggling with is that my current collection values are in a nested table.

 

Thanks!

2 ACCEPTED SOLUTIONS

Accepted Solutions
alaabitar
Solution Specialist
Solution Specialist

Hello,

 

I would suggest that rather than just filling the collection with 'Created By'.Email you can fill it with just the 'Created By' object so that your colusers collection will contains all the user profile and then you can do what ever you want with it.

 

Best regards,

Alaa

View solution in original post

WarrenBelz
Super User
Super User

Hi @jerrycrabb ,

You might try this as the Items of your Gallery

AddColumns
   GroupBy(
      AddColumns(
         'Activity Tracker',
         "AuthorMail",
         'Created By'.Email
      ),
      "AuthorMail",
      "Data"
   ),
   "Surname",
   Office365Users.UserProfileV2(AuthorMail).surname,
   "Given",
   Office365Users.UserProfileV2(AuthorMail).givenName,
   "Position",
   Office365Users.UserProfileV2(AuthorMail).jobTitle,
   "Department",
   Office365Users.UserProfileV2(AuthorMail).department
)

 

Please click Accept as solution if my post helped you solve your issue. This will help others find it more readily. It also closes the item. If the content was useful in other ways, please consider giving it Thumbs Up.

Visit my blog Practical Power Apps

 

View solution in original post

3 REPLIES 3
alaabitar
Solution Specialist
Solution Specialist

Hello,

 

I would suggest that rather than just filling the collection with 'Created By'.Email you can fill it with just the 'Created By' object so that your colusers collection will contains all the user profile and then you can do what ever you want with it.

 

Best regards,

Alaa

WarrenBelz
Super User
Super User

Hi @jerrycrabb ,

You might try this as the Items of your Gallery

AddColumns
   GroupBy(
      AddColumns(
         'Activity Tracker',
         "AuthorMail",
         'Created By'.Email
      ),
      "AuthorMail",
      "Data"
   ),
   "Surname",
   Office365Users.UserProfileV2(AuthorMail).surname,
   "Given",
   Office365Users.UserProfileV2(AuthorMail).givenName,
   "Position",
   Office365Users.UserProfileV2(AuthorMail).jobTitle,
   "Department",
   Office365Users.UserProfileV2(AuthorMail).department
)

 

Please click Accept as solution if my post helped you solve your issue. This will help others find it more readily. It also closes the item. If the content was useful in other ways, please consider giving it Thumbs Up.

Visit my blog Practical Power Apps

 

jerrycrabb
Helper I
Helper I

@WarrenBelz @alaabitar  Thank you both!   @alaabitar, that's exactly what I wound up doing.  @WarrenBelz, I'm trying to get the hang of the GroupBy function, so I'll absolutely try that as well. 

 

All the best!  -Jerry

Helpful resources

Announcements
Power Apps Africa Challenge 2022

Power Apps Africa Challenge

Your chance to join an engaging competition of Power Platform enthusiasts.

Super User 2 - 2022 Congratulations

Welcome Super Users

The Super User program for 2022 - Season 2 has kicked off!

September Events 2022

Check out all of these events

Attend in person or online, there are incredible conferences and events happening all throughout the month of September.

Government Carousel

New forum: GCC, GCCH, DoD - Federal App Makers (FAM)

In response to the unique and evolving requirements of the United States public sector, Microsoft has created Power Apps US Government.

Users online (2,056)