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

Announcements

News and Announcements icon
Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Apps / Count the number of oc...
Power Apps
Answered

Count the number of occurence of a name in SP list and diplay them in a gallery

(0) ShareShare
ReportReport
Posted on by 18

Hi, in simple terms I'm stuck in building a simple gallery to show how many meetings have been attended by the different person.

I've a sharepoint listz called Meeting App database which includes, in the column CompanyPersonnel the attendees to the meeting added through a people picker connected with the outlook365 of my organizion.

My challenge is to build a new screen where i list the occurrances, by name, of the different attendees to the meetings (and sort them). As you can imagine, each record will have several attendees,

Any help is most welcome...thanks in advance

Categories:
  • Ami K Profile Picture
    15,689 Super User 2024 Season 1 on at

    @pbonucci - when you say "each record will have several attendees", does that mean your People field is multi-select?

  • pbonucci Profile Picture
    18 on at

    It is an app which records the minutes of meetings and the column  CompanyPersonnel represents the attendees to the meeting and therefore has several names (it is populated via a people picker dropdown box)

  • Ami K Profile Picture
    15,689 Super User 2024 Season 1 on at

    @pbonucci - again, does that mean your People picker allows for multiple selections?

  • pbonucci Profile Picture
    18 on at

    yes, correct

     

  • Ami K Profile Picture
    15,689 Super User 2024 Season 1 on at

    @pbonucci - the below example will output a table displaying each attendee as a unique record, together with the number of occurrences their name has appeared in that column for all rows.

     

    Sort(
     AddColumns(
     GroupBy(
     Ungroup(
     ForAll(
     'Your Table',
     Split(
     Concat(
     CompanyPersonnel,
     ThisRecord.Email & ";"
     ),
     ";"
     )
     ),
     Value
     ),
     Value,
     GroupedItems
     ),
     CountAttendance,
     CountRows(GroupedItems)
     ),
     Value
    )

     

  • pbonucci Profile Picture
    18 on at

    Thanks….i’ve included the script in the Items property of the gallery replacing the correct name of the SP list but it doesn’t work.

    i receive a lot of errors of invalid arguments so I’m afraid I’ve done something not correct..

    any other properties I need to add/fill in the page or gallery to make it working?

     

  • Ami K Profile Picture
    15,689 Super User 2024 Season 1 on at

    @pbonucci - no idea because I cannot see what you have done. Please share a screenshot of the error message.

  • pbonucci Profile Picture
    18 on at

    Thanks, I've deleted the screen and started from skrecth and now it working fine....just a small tweak to be done.....it works well but the first occurrance shows and empty name....I don't know why....the rest are correct as it shows all names with relevant occourence.

  • pbonucci Profile Picture
    18 on at

    I understood why....when splitting the names, it add a semicolon after each names..and also after the last...so it generates an empty field

  • Verified answer
    Ami K Profile Picture
    15,689 Super User 2024 Season 1 on at

    @pbonucci - you can apply a Filter on the output to exclude blanks:

     

    Sort(
     Filter(
     AddColumns(
     GroupBy(
     Ungroup(
     ForAll(
     'Your Table',
     Split(
     Concat(
     CompanyPersonnel,
     ThisRecord.Email & ";"
     ),
     ";"
     )
     ),
     Value
     ),
     Value,
     GroupedItems
     ),
     CountAttendance,
     CountRows(GroupedItems)
     ),
     Len(Value) > 1
     ),
     Value
    )

     

    One important point I neglected to mention in my previous response - this solution is not delegable.

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

Season of Sharing Community Challenge Winners!

Congratulations to our community stars!

Kudos to our 2025 Community Spotlight Honorees

Expanding mentorship, skilling, and AI innovation

Leaderboard > Power Apps

#1
11manish Profile Picture

11manish 397 Super User 2026 Season 2

#2
Mohsin Ali Profile Picture

Mohsin Ali 354

#3
WarrenBelz Profile Picture

WarrenBelz 232 Most Valuable Professional

Last 30 days Overall leaderboard