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 Automate / Gettting Number of Row...
Power Automate
Unanswered

Gettting Number of Rows in a custom object

(0) ShareShare
ReportReport
Posted on by 431

I have a variable PeopleDataTable that i set equal to a json custom object.

I am trying to get the number of rows in  PeopleDataTable. I have tried PeopleDataTable.RowsCount and PeopleDataTable.Count but in both cases I get an error stating that PeopleDataTable doesn't have that property. Please advise. TIA

I have the same question (0)
  • Nived_Nambiar Profile Picture
    18,129 Super User 2025 Season 2 on at

    Hi @Steve48 

     

    for clarity, could you show how your JSON String looks like ?

    Thanks & Regards,

    Nived N 🚀

    LinkedIn: Nived N's LinkedIn
    YouTube: Nived N's YouTube Channel

    🔍 Found my answer helpful? Please consider marking it as the solution!
    Your appreciation keeps me motivated. Thank you! 🙌

  • Srini007 Profile Picture
    3,327 Super User 2025 Season 2 on at

    Hi @Steve48 

     

    Are you trying to get the rows from Datatable? Then you have the Row.count Option, but as you said it's a JSON custom object so JSON don't have Rows. For more suggestion It would be great if you can share a sample JSON, according to the sample you shared we can suggest you next steps

     

    If you find this reply helpful, please consider giving it a LIKE AND

    If this reply answers your question or solves your issue, please ACCEPT AS SOLUTION

     

    Thanks,

    Srini

  • Agnius Bartninkas Profile Picture
    Most Valuable Professional on at

    A custom object is not iterable, it is not a list nor a table. You cannot get the count of objects inside it. The only way to really do it would be to convert it to a string (via Convert custom object to JSON) and then use Parse text to get the number of certain strings in it. Alternatively, you could try passing it to a Python/C# script and use scripting to get the count of items, but that would be tricky, as the syntax is not exactly the same.

     

    If you want us to come up with the pattern to use in Parse text, please provide a sample of the JSON string.

    -------------------------------------------------------------------------
    If I have answered your question, please mark it as the preferred solution. If you like my response, please give it a Thumbs Up.

    I also provide paid consultancy and development services using Power Automate. If you're interested, DM me and we can discuss it.

  • Steve48 Profile Picture
    431 on at

    Hi @Agnius @Srini007  @Nived_Nambiar This is what the string looks like. I only want to know how many dictionaries there are in key 2.  

    result = {
    "1": "xxxxx",
    "2": [
        {
            "full_name": "xxx",
            "first_name": "xxx",
            "last_name": "xxx",
            "full_address": "xxx",
            "city": "xxx",
            "state": "xx",
            "zip_code": "xxxxx",
            "street_address_without_city_state_zip_code": "xxx",
            "status": "xxxxx"
        },
        {
            "full_name": "xxx",
            "first_name": "xxx",
            "last_name": "xxx",
            "full_address": "xxx",
            "city": "xxxx",
            "state": "xx",
            "zip_code": "xxxxx",
            "street_address_without_city_state_zip_code": "xxx",
            "status": "xxxxx"
        },
        {
            "full_name": "xxx",
            "first_name": "xxx",
            "last_name": "xxx",
            "full_address": "xxx",
            "city": "xxxxxx",
            "state": "xx",
            "zip_code": "xxxxx",
            "street_address_without_city_state_zip_code": "xxx",
            "status": "xxxxx"
    }
    ]
  • Agnius Bartninkas Profile Picture
    Most Valuable Professional on at

    Well, key 2 is actually a list. So, it is in fact iterable and does have a .Count property.

    The right way to get it is by doing %result['2'].Count%.

    Note the quotes around 2 there - these are because 2 is a literal name of the property, and not an index. If you do %result[2].Count%, it will fail, because it will think you're trying to access a value at index 2, which is not possible in custom objects (aka dictionaries).

    -------------------------------------------------------------------------
    If I have answered your question, please mark it as the preferred solution. If you like my response, please give it a Thumbs Up.

    I also provide paid consultancy and development services using Power Automate. If you're interested, DM me and we can discuss it.

  • Steve48 Profile Picture
    431 on at

    Hi @Agnius I tried this but got an error stating that result doesn’t have a property of 2. —I used quotes. Tried both single and double quotes. For now I have a workaround in which i am able to determine the number of { in result. This works.

  • Steve48 Profile Picture
    431 on at

    Hi @Agnius Apparently result is just a string

    Steve48_0-1697571127832.png

     

  • Agnius Bartninkas Profile Picture
    Most Valuable Professional on at

    I believe we had already discussed this in a previous topic? You may need to convert %result% to a custom object, because it for some reason is not converted when you converted the entire Answer object.

    -------------------------------------------------------------------------
    If I have answered your question, please mark it as the preferred solution. If you like my response, please give it a Thumbs Up.

    I also provide paid consultancy and development services using Power Automate. If you're interested, DM me and we can discuss it.

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 Automate

#1
Michael E. Gernaey Profile Picture

Michael E. Gernaey 525 Super User 2025 Season 2

#2
Tomac Profile Picture

Tomac 324 Moderator

#3
abm abm Profile Picture

abm abm 232 Most Valuable Professional

Last 30 days Overall leaderboard