Skip to main content

Notifications

Community site session details

Community site session details

Session Id : uHuYZmDJVHDft4y/28z9DN
Power Automate - Power Automate Desktop
Unanswered

Get list of properties from custom object

Like (0) ShareShare
ReportReport
Posted on 8 Dec 2021 19:16:50 by 2

I am building a flow that has a custom object with, let's say, the following data in json:

 

{
"foo": "a",
"bar": "b",
"baz": 100
}

 

This json comes from a Web API and may change depending on what is being sent. I wanted to know if there is a way to extract the list of properties to loop over. I.E, in this case I would have a list of Text ["foo", "bar", "baz"]

 

 

  • anp882 Profile Picture
    10 on 13 May 2024 at 20:37:10
    Re: Get list of properties from custom object

    I tried the following in a condition and an object assigned to a variable
    This:
    variables('YourVariable')?['YourProperty'] is equal to null
    was not evaluating to true, even when property didn't exist. But this:
    empty(variables('YourVariable')?['YourProperty']) is equal to true
    was working fine.

  • tfitzger Profile Picture
    2 on 09 Dec 2021 at 18:50:28
    Re: Get list of properties from custom object

    Thanks, @Henrik_M . I have something like that already in place, but I was curious if there was something less hacky. Ah well.

  • Henrik_M Profile Picture
    2,006 Super User 2024 Season 1 on 08 Dec 2021 at 22:28:51
    Re: Get list of properties from custom object

    I'm not sure if there is a way to extract the property names from the object, put I guess you could use a regex "hack" to grab them from the JSON string. Try pasting this into your desktop flow:

    SET JSON TO $'''{
    \"foo\": \"a\",
    \"bar\": \"b\",
    \"baz\": 100
    }'''
    Text.ParseText.RegexParse Text: JSON TextToFind: $'''(?<=\").+?(?=\":)''' StartingPosition: 0 IgnoreCase: False Matches=> Matches

     

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

🌸 Community Spring Festival 2025 Challenge Winners! 🌸

Congratulations to all our community participants!

Warren Belz – Community Spotlight

We are honored to recognize Warren Belz as our May 2025 Community…

Congratulations to the April Top 10 Community Stars!

Thanks for all your good work in the Community!

Leaderboard > Power Automate - Power Automate Desktop

#1
eetuRobo Profile Picture

eetuRobo 64 Super User 2025 Season 1

#2
Nived_Nambiar Profile Picture

Nived_Nambiar 18 Super User 2025 Season 1

#3
CU12050101-0 Profile Picture

CU12050101-0 12

Overall leaderboard
Loading started