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 / How to count the items...
Power Apps
Answered

How to count the items in powerapps label

(0) ShareShare
ReportReport
Posted on by

Hello,

 

I have built a Powerapps gallery, which added the user calendar. I need to get the count of attendees of the of the particular item, I tried this formulae, on the text label property like count(thisitem.required attendees) but it is giving the error. is there any way to calculate this?

Categories:
I have the same question (0)
  • LuizVicente Profile Picture
    984 Super User 2024 Season 1 on at

    Try this:

    CountRows(YourSource.Column) // YourSource is not the gallery but your original data source.
  • Community Power Platform Member Profile Picture
    on at

    Hello @LuizVicente 

     

    Thanks for the response. But unfortunately the formulae is not working. The Error was "Invalid argument type (Text). Expecting a table value instead". 

    Kindly refer the below screenshot. Please remember that the Data source is an Outlook Calendar!

     

    Sa7_0-1661061013507.png

     

  • v-liwei-msft Profile Picture
    on at

    Hi @Anonymous ,

     

    Using CountRows is a very correct approach. 

    The problem is that the RequiredAttendees property returns a semicolon-delimited String of required attendee names for the meeting appointment. 

    You can first use the split function on ThisItem.RequiredAttendees to create an array with a semicolon as a separator. 

    Use CountRows on the results returned by split.

    I have made a test for your reference:

    vliweimsft_0-1661320405227.jpeg

     

    Best Regards,

    Levi

     

  • Community Power Platform Member Profile Picture
    on at

    @v-liwei-msft Thanks for the help. But it is not returning the exact count. It is incrementing to 1 number for each item,  not sure why!

     

    In the formulae I have decremented the value to "-1" to get the proper output. Anyway thanks for the solution.

  • v-liwei-msft Profile Picture
    on at

    Hi @Anonymous ,

     

    Could you please show me your formula and the screenshot of result?

    Thanks!!!

     

    Best Regards,

    Levi

  • Community Power Platform Member Profile Picture
    on at

    Hello @v-liwei-msft 

     

    No Problem. I am able to get the targeted output.  I actually have another query. I am able to count the number of attendees for each item, I have used label defined the formulae to count those in the Gallery.  

     

    But now I want to add all the outputs of the label. It is unique to each item in the Galley, when I actually write the formulae like label.text it is only giving the first Item value. is there any way to add all the values.

     

    Sa7_0-1661421160277.png

     

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

    Hi @Anonymous ,

     

    I suggest you to use the sum function.

    I have made a test for your reference:

    vliweimsft_0-1661478205713.png

    vliweimsft_1-1661478215805.png

    I think this link will help you a lot:

    Solved: How to sum numeric fields inside a browsegallery - Power Platform Community (microsoft.com)

     

    Best Regards,

    Levi

     

     

  • Community Power Platform Member Profile Picture
    on at

    @v-liwei-msft Thank you very much. The formulae is fetching the expected output.

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