cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
Frequent Visitor

How equality of objects is evaluated

Hi,
While making a review of a flow I spotted a condition action that made me wonder.
It was checking for the equality between objects. Those were results of select actions on arrays from different sources so definitely not the same instance/reference.
And I'm now curious about internals of equality evaluation between objects in Flow/LogicApps. From what I tested it seems to compare each property. Is it something that can be relied on? Is any documentation on this topic?


Kind regards,
Bartosz Domżalski

1 ACCEPTED SOLUTION

Accepted Solutions
Highlighted
Super User III
Super User III

Re: How equality of objects is evaluated

@bdomzalski 

 

When comparing objects, every aspect of the object is compared.

 

So the reason of using Select actions, is to build out a object/array that has the same structure.

Example:

JSON1:

{

"employee": "Jcook",

"ID":  1,

"title": "Developer"

}

 

JSON2:

{

"ID":  1,

"position": "Developer",

"userName": "Jcook"

}

 

 

I would use a select or compose action to build my own array/JSON object to compare them. Example:

Build New JSON1:

{

"employeeID": 1,

"title": "Developer",

"user": "Jcook" 

}

 

Build New JSON2:

{

"employeeID": 1,

"title": "Developer",

"user": "Jcook" 

}

 

 

Now since the property names are the same (left value) we can use a condition to compare the objects





Did I answer your question? Mark my post as a solution!

If you like my post please hit the Thumbs Up


Proud to be a Flownaut!


Check out my blog for Power Automate tips, tricks, and guides
FlowAltDelete




View solution in original post

1 REPLY 1
Highlighted
Super User III
Super User III

Re: How equality of objects is evaluated

@bdomzalski 

 

When comparing objects, every aspect of the object is compared.

 

So the reason of using Select actions, is to build out a object/array that has the same structure.

Example:

JSON1:

{

"employee": "Jcook",

"ID":  1,

"title": "Developer"

}

 

JSON2:

{

"ID":  1,

"position": "Developer",

"userName": "Jcook"

}

 

 

I would use a select or compose action to build my own array/JSON object to compare them. Example:

Build New JSON1:

{

"employeeID": 1,

"title": "Developer",

"user": "Jcook" 

}

 

Build New JSON2:

{

"employeeID": 1,

"title": "Developer",

"user": "Jcook" 

}

 

 

Now since the property names are the same (left value) we can use a condition to compare the objects





Did I answer your question? Mark my post as a solution!

If you like my post please hit the Thumbs Up


Proud to be a Flownaut!


Check out my blog for Power Automate tips, tricks, and guides
FlowAltDelete




View solution in original post

Helpful resources

Announcements
firstImage

Super User Program Update

Three Super User rank tiers have been launched!

firstImage

Power Platform 2020 release wave 2 plan

Features releasing from October 2020 through March 2021

firstImage

New & Improved Power Automate Community Cookbook

We've updated and improved the layout and uploading format of the Power Automate Cookbook!

thirdimage

Power Automate Community User Group Member Badge

Fill out a quick form to claim your user group badge now!

Top Solution Authors
Top Kudoed Authors
Users online (9,080)