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 / Comparing 2 JSONs with...
Power Automate
Answered

Comparing 2 JSONs with same keys

(0) ShareShare
ReportReport
Posted on by 4

Hello

 

I want to compare, by a Power Automate Flow, 2 JSONs that have the same keys but can differ in key values. The goal here is to get the amount of keys that have the same value, as it follows:

 

JSON1 - that has the correct answers

 

{
"Answer 1" : "a",
"Answer 2" : "b",
"Answer 3" : "d",
"Answer 4" : "a",
"Answer 5" : "c",
"Answer 6" : "b",
"Answer 7" : "d",
"Answer 8" : "b",
"Answer 9" : "a",
"Answer 10" : "c"
}

 

 

JSON 2 - that has the given answers

 

{
"Answer 1" : "a",
"Answer 2" : "b",
"Answer 3" : "d",
"Answer 4" : "a",
"Answer 5" : "b",
"Answer 6" : "b",
"Answer 7" : "d",
"Answer 8" : "b",
"Answer 9" : "d",
"Answer 10" : "c"
}

 

 

In that case, I want to obtain the value 8, since all the 10 keys of the 2 JSONs, except by the keys "Answer 5" and "Answer 9", have the same values

Categories:
I have the same question (0)
  • Verified answer
    grantjenkins Profile Picture
    11,063 Moderator on at

    Try the expression intersection passing in both of your inputs. This should return just the ones that are the same. You can then use length to get the number of items.

  • vroeder Profile Picture
    4 on at

    it worked so well! I tought intersection and lenght could be used only to arrays. Thank you so much!

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
David_MA Profile Picture

David_MA 77 Super User 2026 Season 1

#2
Haque Profile Picture

Haque 68

#3
Expiscornovus Profile Picture

Expiscornovus 56 Most Valuable Professional

Last 30 days Overall leaderboard