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 Apps / JSON() function wraps ...
Power Apps
Answered

JSON() function wraps array objects in extraneous Value() object

(0) ShareShare
ReportReport
Posted on by 313

Hi,

 

I am using Power Automate (formerly Microsoft Flow) to intermediate communication with a Cosmos DB, with good success. 

 

However, there are some peculiarities that bother me. 

Given the record created by: 

 

Set(domain_update,
{
 pkey: "domains",
 id: "",
 ou_id: LookUp(cosmos_ous_col,ou_id = GalleryDomains.Selected.ou_id).id,
 domain: GalleryDomains.Selected.domain,
 foreign_id:[{
 system:"contoso",
 pkey:"fubar",
 key:"id",
 value:GalleryDomains.Selected.id
 }]
}
);

 

 

One would expect that the foreign_id property would become an array of objects like:

 

...
foreign_id: [
 {
 "system": "contoso",
 ...
 },
 {
 "system": "fabrikam",
 ...
 }
]

 

 

However, when I JSON() the variable domain_update, what I get is: 

 

...
foreign_id: [
 {
 "Value":
 {
 "system": "contoso",
 ...
 }
 },
 {
 "Value":
 {
 "system": "fabrikam",
 ...
 }
 }
]

 

 


It seems counter-intuitive an unjustified to wrap the objects around like that, and I didn't find anything in the documentation on ways to prevent this wrapping. 

 

What is causing, and is there a way to prevent the double-objectification? 

 

THanks

 

Categories:
I have the same question (0)
  • Verified answer
    v-siky-msft Profile Picture
    Microsoft Employee on at

    Hi @TiagoFreire ,

     

    Please try to modify your codes as below, use Table() function to format a table instead of [] operator.

    Set(domain_update,
    {
     pkey: "domains",
     id: "",
     ou_id: LookUp(cosmos_ous_col,ou_id = GalleryDomains.Selected.ou_id).id,
     domain: GalleryDomains.Selected.domain,
     foreign_id:Table({
     system:"contoso",
     pkey:"fubar",
     key:"id",
     value:GalleryDomains.Selected.id
     })
    }
    );

     Best regards,

    Sik

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

Congratulations to the July Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Apps

#1
WarrenBelz Profile Picture

WarrenBelz 401 Most Valuable Professional

#2
11manish Profile Picture

11manish 201 Super User 2026 Season 2

#3
MS.Ragavendar Profile Picture

MS.Ragavendar 128 Super User 2026 Season 2

Last 30 days Overall leaderboard