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

Displaying only the first three Office 365 User Profile Pictures from a collection

I have a Horizontal Gallery displaying Office 365 User Profile Pictures.

I want to display only the 3 first Office 365 User Profile Pictures from a collection collected from a dataverse table.

And if the collection have more than 3 records, I want an icon displaying +5(the count of the remaining participants in the collection). 

How I want it to look is displayed in the attched screenshot.

 

I have attempted using the following formula: for the first picture:

If(!IsBlank(First(ThisItem.UPN), Office365Users.UserPhotoV2(First(ThisItem.UPN)))

But then I receive the error "Expecting a Table Value instead". I do not understand why I get this error? The Collection is a Table?

 

I use the following formula now:

If(!IsBlank(ThisItem.UPN),Office365Users.UserPhotoV2(ThisItem.UPN))

This formula works, but its displaying all the Office 365 User Profile Pictures that exist in the collection not only the three first photos.

 

How should I write the formula in the Image-component within the gallery to display the first, the second and the third Office 365 User Profile Picture from the collection? 

 

1 ACCEPTED SOLUTION

Accepted Solutions
iAm_ManCat
Super User
Super User

I would filter the Items property of the gallery to only have three items using FirstN, and then for your +X label have something like

 

Visible:

CountRows(datasource)>3

 

label text for the +X part

"+" & (CountRows(datasource)-3)

 

@iAm_ManCat


Please 'Mark as Solution' if someone's post answered your question and always 'Thumbs Up' the posts you like or that helped you!


Thanks!
You and everyone else in the community make it the awesome and welcoming place it is, keep your questions coming and make sure to 'like' anything that makes you 'Appy
Sancho Harker, MVP


View solution in original post

3 REPLIES 3
iAm_ManCat
Super User
Super User

I would filter the Items property of the gallery to only have three items using FirstN, and then for your +X label have something like

 

Visible:

CountRows(datasource)>3

 

label text for the +X part

"+" & (CountRows(datasource)-3)

 

@iAm_ManCat


Please 'Mark as Solution' if someone's post answered your question and always 'Thumbs Up' the posts you like or that helped you!


Thanks!
You and everyone else in the community make it the awesome and welcoming place it is, keep your questions coming and make sure to 'like' anything that makes you 'Appy
Sancho Harker, MVP


Thank you @iAm_ManCat! This worked out perfectly. 

I used FirstN(Collection,3) in the items gallery

Excellent, glad I could help 🙂

@iAm_ManCat


Please 'Mark as Solution' if someone's post answered your question and always 'Thumbs Up' the posts you like or that helped you!


Thanks!
You and everyone else in the community make it the awesome and welcoming place it is, keep your questions coming and make sure to 'like' anything that makes you 'Appy
Sancho Harker, MVP


Helpful resources

Announcements
Power Apps News & Annoucements carousel

Power Apps News & Announcements

Keep up to date with current events and community announcements in the Power Apps community.

Community Call Conversations

Introducing the Community Calls Conversations

A great place where you can stay up to date with community calls and interact with the speakers.

Power Apps Community Blog Carousel

Power Apps Community Blog

Check out the latest Community Blog from the community!

Top Solution Authors
Top Kudoed Authors
Users online (2,975)