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 / manipulate the compose...
Power Automate
Answered

manipulate the compose output into array of objects

(0) ShareShare
ReportReport
Posted on by 870 Super User 2026 Season 1
Hello!
 
This is a challenge, at least for me!
 
I was able to use a compose split to get the following output. Not sure what to do next.
 
Using power automate flow actions, I need to convert the following compose output into an array of objects.
 
Each row of data in the array contains the columns as follows:
department_number,
department_name,
category_number,
category_name,
class_number,
class_name,
item_number,
fullItemDescription
 
 
Example row in table form:
department_number department_name category_number category_name class_number class_name item_number fullItemDescription
4 GROCERY 19 CRACKERS 22 Cheese Crackers 111222 Cheez-it Original Crackers 12.4 OZ
 
 
Better example:
[
  {
    "department_number": "4",
    "department_name": "GROCERY",
    "category_number": "19",
    "category_number": "CRACKERS",
    "class_number": "22",
    "class_name": "Cheese Crackers",
    "item_number": "111222",
    "fullItemDescription": "Cheez-it Original Crackers 12.4 OZ"
  },
 ]
 
 
Compose output:
["[[\"4\",\"GROCERY\",\"19\",\"CRACKERS\",\"22\",\"Cheese Crackers\",\"111222\",\"Cheez-it Original Crackers 12.4 OZ\"",
"\"3\",\"PRODUCE\",\"22\",\"Cooking Greens\",\"1\",\"BULK COOKING GREENS\",\"333444\",\"Organic Kale Green\"",
"\"90\",\"Homestyle American\",\"2\",\"Chicken\",\"1\",\"Rotisserie Chicken\",\"555666\",\"Whole Rotisserie Plain\"",
"\"3\",\"PRODUCE\",\"54\",\"Bananas\",\"1\",\"BANANAS\",\"777888\",\"Bananas\"",
"\"3\",\"PRODUCE\",\"18\",\"Salad Leaf (New)\",\"2\",\"BULK ICEBERG\",\"999111\",\"Iceberg Lettuce 1 EA\"",
"\"85\",\"Asian Foods and Bowls\",\"3\",\"Asian Hot Bars\",\"1\",\"Asian Self Serve Bars\",\"888222\",\"Hot Bar\"",
"\"52\",\"WINE\",\"27\",\"OREGON\",\"40\",\"Pinot Noir\",\"777333\",\"Erath Pinot Noir\"]]"]
 
 
 
Screen shot of the Compose output ...
 
 
 
Categories:
I have the same question (0)
  • Power Platform 1919 Profile Picture
    2,205 Super User 2026 Season 1 on at
    Hi @,
    can you help me with expression or step about how you got that result with screenshots , based on that we can help you better
  • Cgangweg01 Profile Picture
    870 Super User 2026 Season 1 on at
     
    Thanks for taking a look at this post.
     
    I was able to put a solution together which I'll share in a document and post today as well. However, I think it can be done better. It is a bit of a hack job - IMO.
     
    To get the data for this use case I have to use a child flow that is performing a SQL query using a Databricks connection.
    The body that comes back looks like this:
     
        "body": {
            "results": "[[\"4\",\"GROCERY\",\"19\",\"CRACKERS\",\"22\",\"Cheese Crackers\",\"111222\",\"Cheez-it Original Crackers 12.4 OZ\"],[\"3\",\"PRODUCE\",\"22\",\"Cooking Greens\",\"1\",\"BULK COOKING GREENS\",\"333444\",\"Organic Kale Green\"],[\"90\",\"Homestyle American\",\"2\",\"Chicken\",\"1\",\"Rotisserie Chicken\",\"555666\",\"Whole Rotisserie Plain\"],[\"3\",\"PRODUCE\",\"54\",\"Bananas\",\"1\",\"BANANAS\",\"777888\",\"Bananas\"],[\"3\",\"PRODUCE\",\"18\",\"Salad Leaf (New)\",\"2\",\"BULK ICEBERG\",\"999111\",\"Iceberg Lettuce 1 EA\"],[\"85\",\"Asian Foods and Bowls\",\"3\",\"Asian Hot Bars\",\"1\",\"Asian Self Serve Bars\",\"888222\",\"Hot Bar\"],[\"52\",\"WINE\",\"27\",\"OREGON\",\"40\",\"Pinot Noir\",\"777333\",\"Erath Pinot Noir\"]]"
        }
    }
     
    The above is actually seven records that the SQL query returns successfully. Why in this format, I don't know.
     
     
  • Power Platform 1919 Profile Picture
    2,205 Super User 2026 Season 1 on at
    On a high level, I can understand you are using child flow to get data, and I think in child you are using respond to power app /flow action (which generally outputs as text).
     
    Now the question is can you please share the screenshot of the child flow (what I want to see the respond to master flow part along with how it is getting generated(mask the sensitive data))
  • Cgangweg01 Profile Picture
    870 Super User 2026 Season 1 on at
     
    Here is the child flow...
     
     
     
     
  • Verified answer
    Chriddle Profile Picture
    8,672 Super User 2026 Season 1 on at
    From:
    json(body('Compose').results)
     
    Map department_number: 
    item()[0]
     
    Map department_name:
    item()[1]
     
    Map category_number:
    item()[2]
     
    etc.
     
  • Cgangweg01 Profile Picture
    870 Super User 2026 Season 1 on at
    my solution so far, attached
  • Power Platform 1919 Profile Picture
    2,205 Super User 2026 Season 1 on at
    We can't see your document yet as it is still under scanning 
    Can I know the reason on why you are using body/result/dataarray (it gives values as array)
     
    I have never used azure databricks but any sql statements execution (sql server) generally it gives you Json formatted data.
     
    If you want to see if it is giving json structure or not.
    I suggest you to try adding compose with inputs as body(dynamic content) from sql statement execution.
    Do a test run, you will see the structure based on it you can adjust the respond part.
     
  • Cgangweg01 Profile Picture
    870 Super User 2026 Season 1 on at
     
    Thank you both for responding!
     
    Power Apps 1919,
    The 'body/result/dataarray' was picked by someone else who shared, as a user only, the child flow with me (needing to leverage his data access). It worked within Power Apps with string manipulation of course.
     
     
    Chriddle,  I can't believe that a simple Select action took care of everything. I don't understand how it knew how to break that input down by index with all the slashes, quotes and weirdly placed commas, etc. Can something similar be done in Power Apps if that child flow is called from an app button and returns the same results?
  • Power Platform 1919 Profile Picture
    2,205 Super User 2026 Season 1 on at
    Hi ,
    it can be achieved in power apps also.
    It would be bit complex
     
    For that you have to use index with split function within a forall function.
     
    Do you have any powerfx to share, so that we can look into it 
  • Chriddle Profile Picture
    8,672 Super User 2026 Season 1 on at
     I don't understand how it knew how to break that input down by index with all the slashes, quotes and weirdly placed commas, etc.
    This is just a stringified JSON within the JSON, the function json('<value>') takes care of this.

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

Introducing the 2026 Season 1 community Super Users

Congratulations to our 2026 Super Users!

Kudos to our 2025 Community Spotlight Honorees

Congratulations to our 2025 community superstars!

Leaderboard > Power Automate

#1
Haque Profile Picture

Haque 589

#2
Valantis Profile Picture

Valantis 328

#3
David_MA Profile Picture

David_MA 284 Super User 2026 Season 1

Last 30 days Overall leaderboard