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 Automate / Converting randomized ...
Power Automate
Answered

Converting randomized number objects into an array

(0) ShareShare
ReportReport
Posted on by 4
I have a data source that I'm bringing into power automate using an HTTP request. 
 
In order to work with the data I need to have all of the properties inside the user_id objects into an array. In reality these user id's are random numbers, so I cant see a way to reference the object field. I can compose for outputs all the way down to the user id, but the user id objects are still present, so its just an array of objects. The properties that I really need to get to are id, display_name, and group_id
 
Does anyone have any advice for how to put these objects into an array? remember that the object name for user id is different for each user. Heres an image of the data structure.
 
Categories:
  • Suggested answer
    Nived_Nambiar Profile Picture
    18,138 Super User 2026 Season 1 on at
    Hi
     
    Try using xpath as shown below
     
    Here we have to use 3 different xpath expression to get id, groupid and display_name in 3 different array as shown below
     
    Assume the below compose action has following JSON object
     
    Now use another compose action to use xpath expression to get the id attribute from it in array format as shown below
     
     
    xpath(xml(outputs('Compose')),'//id/text()')
     
    Simmilarly to get other node values> try these expression for getting group_id and display_name 
    xpath(xml(outputs('Compose')),'//group_id/text()')
    xpath(xml(outputs('Compose')),'//display_name/text()')
     
     
    Hope it helps !
     
    Mark it as solution if it resolves your query !
     
    Thanks & Regards,
    Nived N
     
  • KA-08112210-0 Profile Picture
    4 on at
    Thank you Nived, 
     
    It ended up being a bit more complicated then this. I had to compose with the Root, Compose with XML, Use XPath, then decode from Base64, Clean the Ids, and then re-iterate through the data, but without your answer I could have never figured this out! Xpath is a very useful tool that I wasn't aware of. Much appreciated!

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 Automate

#1
Mohsin Ali Profile Picture

Mohsin Ali 426

#2
11manish Profile Picture

11manish 349 Super User 2026 Season 2

#3
M Bilal Khan Profile Picture

M Bilal Khan 308

Last 30 days Overall leaderboard