# Counting items (rows) in Datagrid

**URL:** <https://forum.robotframework.org/t/counting-items-rows-in-datagrid/7707>\
**Category:** Robot Framework\
**Created:** [16 August 2024 10:44 UTC](https://forum.robotframework.org/t/counting-items-rows-in-datagrid/7707 "2024-08-16T10:44:11Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![Tress](https://avatars.discourse-cdn.com/v4/letter/t/9d8465/32.png) [@Tress](https://forum.robotframework.org/u/Tress)\
**Post date:** [16 August 2024 10:44 UTC](https://forum.robotframework.org/t/counting-items-rows-in-datagrid/7707/1 "2024-08-16T10:44:11Z")

</div>

Hello,

I’m trying to count the items (rows) in a DataGrid in a desktop app and save the count as a value in my script, but all my attempts haven’t worked. How can I do it? I would be really grateful for any advice.

---

<div class="post-metadata">

**Author:** ![damies13](https://dub1.discourse-cdn.com/flex005/user_avatar/forum.robotframework.org/damies13/32/623_2.png) [@damies13](https://forum.robotframework.org/u/damies13)\
**Post date:** [16 August 2024 11:07 UTC](https://forum.robotframework.org/t/counting-items-rows-in-datagrid/7707/2 "2024-08-16T11:07:28Z")

</div>

Hi Michaela (or do you prefer Tress?),

Which Library are you using for the desktop app? Also which OS are you using?

Depending on the library it might not be easy/possible.

Also sometimes with desktop apps it’s easier to get a count from a status bar (if one exists) than to get the row count. But it depends on your application.

Dave.

---

<div class="post-metadata">

**Author:** ![Tress](https://avatars.discourse-cdn.com/v4/letter/t/9d8465/32.png) [@Tress](https://forum.robotframework.org/u/Tress)\
**Post date:** [16 August 2024 11:39 UTC](https://forum.robotframework.org/t/counting-items-rows-in-datagrid/7707/3 "2024-08-16T11:39:33Z")

</div>

Hi Dave,

I am using the FlaUI library (but I also tried RPA and White Library) on Windows. There is no status bar or other component that shows the count of items in the DataGrid. I tried to create a list of items from the DataGrid and then save the length of this list, but I’m not sure if these steps will work.

(and you can call me Michaela or Trees—it’s completely up to you)

---

<div class="post-metadata">

**Author:** ![damies13](https://dub1.discourse-cdn.com/flex005/user_avatar/forum.robotframework.org/damies13/32/623_2.png) [@damies13](https://forum.robotframework.org/u/damies13)\
**Post date:** [16 August 2024 11:53 UTC](https://forum.robotframework.org/t/counting-items-rows-in-datagrid/7707/4 "2024-08-16T11:53:15Z")

</div>

Hi Trees,

Well the good new is FlaUI libraryis the one most likely to be able to give you a row count, it has a keyword [Get Grid Rows Count](https://gdatasoftwareag.github.io/robotframework-flaui/keywords/3.3.0.html#Get%20Grid%20Rows%20Count) that should help.

It’s been nearly 5 years since I used this Library, and I don’t use Windows much anymore, so hopefully someone else can jump in and help you with any questions 🤞 If not, I’ll try my best to help.

If you haven’t already, it’s probably a good idea to review the [XPath explanation](https://gdatasoftwareag.github.io/robotframework-flaui/xpath.html) and to install [FlaUI Inspect](https://github.com/FlaUI/FlaUInspect)

Dave.
