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 / Modify the solution in...
Power Automate
Answered

Modify the solution in https://powerusers.microsoft.com/t5/General-Power-Automate/How-to-search-for-duplicate-values-in-Azure-Devops-using-Power/m-p/2020221#M118341

(0) ShareShare
ReportReport
Posted on by Microsoft Employee

I need to impose additional constraints to the issue in Solved: Re: How to search for duplicate values in Azure De... - Power Platform Community (microsoft.com).

 

[
  {
    "System.Id"432822,
    "System.Title""Flow test - 1",
     "Release": "2012"
    "OSG.KBArticleNumber""123456"
  },
  {
    "System.Id"432823,
    "System.Title""Flow test - 1",
     "Release": "2013"
    "OSG.KBArticleNumber""123456"
  },
  {
    "System.Id"432821,
    "System.Title""flow test - 2",
     "Release": "2012"
    "OSG.KBArticleNumber""123456"
  },
  {
    "System.Id"432828,
    "System.Title""flow test - 3",
     "Release": "2012"
    "OSG.KBArticleNumber""1234567"
  }
]
Earlier solution was with group by only KBArticleNumber. Now I need to introduce 'Release' also to the group by. The output is to look like 
[
  {
    "Id": [432823],
     "Release": "2013",
    "KBArticleNumber": "123456"
  },
  {
    "Id": [432821, 432822],
    "Release": "2012",
    "KBArticleNumber": "123456"
  },
  {
    "Id": [432828],
     "Release": "2012",
    "KBArticleNumber": "1234567"
  }
]
 
Categories:
I have the same question (0)
  • Chriddle Profile Picture
    8,638 Super User 2026 Season 1 on at

    I don't get it 😕

    At first glance, this looks like a simple name change in the property.

    You should extend your example data and show the expected output data structure.

  • kryalava Profile Picture
    Microsoft Employee on at

    The output should look like this.

     

    [
      {
        "Id": [432823],
         "Release": "2013",
        "KBArticleNumber": "123456"
      },
      {
        "Id": [432821, 432822],
        "Release": "2012",
        "KBArticleNumber": "123456"
      },
      {
        "Id": [432828],
         "Release": "2012",
        "KBArticleNumber": "1234567"
      }
    ]

  • Chriddle Profile Picture
    8,638 Super User 2026 Season 1 on at

    If there are multiple items with same KBArticleNumber and different release years, what should the output look like?

  • Chriddle Profile Picture
    8,638 Super User 2026 Season 1 on at

    I withdraw my question 😉

  • Chriddle Profile Picture
    8,638 Super User 2026 Season 1 on at

    The approach to get the From value of the Select action is different:

    A Select action to get all Number-Release combinations with Map:

     

    {
     "KBArticleNumber": @{item()['OSG.KBArticleNumber']},
     "Release": @{item()['Release']}
    }

     

    and a compose action to make them unique:

     

    union(body('NumberReleaseDuplicates'), skip(createArray(0), 1))

     

    Finally there are a few changes in the main Select action to handle the new From, also check Release in xpath and add Release:

    From:

     

    @{outputs('NumberRelease')}

     

    Map:

     

    {
     "KBArticleNumber": @{item()['KBArticleNumber']},
     "Id": @{xpath(
    	xml(
    		json(
    			concat(
    				'{"root":{"obj":',
    				outputs('Compose_data'),
    				'}}')
    		)
    	),
    	concat(
    		'//obj[OSG.KBArticleNumber[text()="',
    		item()['KBArticleNumber'],
    		'"] and Release[text()="',
    		item()['Release'],
    		'"]]/System.Id/text()'
    	)
    )},
     "Release": @{item()['Release']}
    }

     

     

    Chriddle_1-1677068687098.png

     

  • kryalava Profile Picture
    Microsoft Employee on at

    Thank you. This worked.

     

    Similar to checking the Release, I want to add additional values, like Product. I made the changes to the NumberReleaseDuplicates to have the Product in the map and assigned the value as below.

            "select": {
                "KBArticleNumber""@item()['OSG.KBArticleNumber']",
                "Release""@item()['Release']",
                "Product""@item()['OSG.Product']"
            }
     
    No changes made to the NumberRelease.
     
    In the Select, what should be the changes that need to be made ?
    From: No changes.
    Select->
    workitemID
    xpath(  xml(json(concat('{"root":{"obj":',body('Parse_JSON'),'}}'))), concat('//obj[OSG.KBArticleNumber[text()="',item()['KBArticleNumber'],
            '"] and Release[text()="', item()['Release'],
            '"]]/System.Id/text()'
        )
    )
     
     
    kryalava_0-1677151979357.png

     

  • Verified answer
    Chriddle Profile Picture
    8,638 Super User 2026 Season 1 on at

    Same pattern as above:

     

    xpath(
    	xml(
    		json(
    			concat(
    				'{"root":{"obj":',
    				outputs('Compose_data'),
    				'}}')
    		)
    	),
    	concat(
    		'//obj[OSG.KBArticleNumber[text()="',
    		item()['KBArticleNumber'],
    		'"] and Release[text()="',
    		item()['Release'],
    		'"] and Product[text()="',
    		item()['Product'],
    		'"]]/System.Id/text()'
    	)
    )

     

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 262 Super User 2026 Season 1

#2
Haque Profile Picture

Haque 227

#3
Expiscornovus Profile Picture

Expiscornovus 225 Most Valuable Professional

Last 30 days Overall leaderboard