Skip to main content

Notifications

Community site session details

Community site session details

Session Id :
Customer experience | Sales, Customer Insights,...
Suggested answer

How to store data in Object of array format in power automate?

(0) ShareShare
ReportReport
Posted on by
Hi All,
 
I have a power automate and I have declared an array variable, in this array variable I am appending two attribute from the list result of opportunity entity.
 

[
"OppUrl":"URL",
"OppID":"Opportunityid"
]
but result is showing like:
[
    "\n[\n\"OppUrl\":\"URL\",\n\"OppID\":\"ID\"\n]\n",
   "\n[\n\"OppUrl\":\"URL\",\n\"OppID\":\"ID\"\n]\n",
     "\n[\n\"OppUrl\":\"URL\",\n\"OppID\":\"ID\"\n]\n",
   "\n[\n\"OppUrl\":\"URL\",\n\"OppID\":\"ID\"\n]\n",
]
I need the result like :
[
{
  "OppUrl": "url",
   "OppID": "123"
},

{
"OppUrl": "url",
   "OppID": "345"
},

{
"OppUrl": "url",
   "OppID": "678"
}

]
 
 
 
How can I achieve the result like above JSON?
 
 
 
 
  • Suggested answer
    Tom_Gioielli Profile Picture
    1,680 on at
    How to store data in Object of array format in power automate?
    There might be a few things wrong here, so I'll start at the beginning. If you want to end up with an array of values from a query in Power Automate, you can do the following.
     
    • Trigger your flow however needed (schedule, manual, etc.)
    • Dataverse - List Rows action
    • Data Operation - Select
      • This is where we are going to build up our array of results
      • From: value(list of items)
      • Map: Your data fields
    At this point, you should be able to then Parse the outputs of the Select operation if you want to do some sort of work on the array or do whatever you need with it. Here is a screenshot of the whole thing.
     
    The outputs from the above flow in my demo environment was as follows.
     
    [
      {
        "Opportunity ID": "9b9ed419-af30-ee11-bdf3-000d3a14bdde",
        "Opportunity Name": "10 orders of Product SKU JJ202 (sample)"
      },
      {
        "Opportunity ID": "9d9ed419-af30-ee11-bdf3-000d3a14bdde",
        "Opportunity Name": "10 orders or Product SKU AX305 this summer (sample)"
      },
      {
        "Opportunity ID": "9f9ed419-af30-ee11-bdf3-000d3a14bdde",
        "Opportunity Name": "Some interest in our JJ line of products (sample)"
      },
      {
        "Opportunity ID": "a19ed419-af30-ee11-bdf3-000d3a14bdde",
        "Opportunity Name": "Office 365 Services"
      }
    ]
     
     
    A few other random things I noticed in your flow.
    • the column with schema 'opportuntiyid' is the GUID of the record, like seen in my outputs. You might be looking for some other custom ID used in the system, so you will want to make sure you grab the correct schema name
    • 'Oppurl' is also not a result of the outputs in List Rows for Dataverse that I'm aware of, so if it is a custom field you are missing a prefix or something on the schema name
    • If you are going to manually build up the array instead of use the Select action, don't put your variables inside quotes. This will cause the flow to take the values as literal strings instead of the merged value
     
    I hope this helps. I think you are close, just a few extra steps throwing you off. If this answer helped, please consider marking as verified.

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

Jainam Kothari – Community Spotlight

We are honored to recognize Jainam Kothari as our June 2025 Community…

Congratulations to the May Top 10 Community Leaders!

These are the community rock stars!

Announcing the Engage with the Community forum!

This forum is your space to connect, share, and grow!

Leaderboard >

Product updates

Dynamics 365 release plans