web
You’re offline. This is a read only version of the page.
close
Skip to main content
Community site session details

Community site session details

Session Id : p7MonjosP78vBKfyRmXX7/
Power Automate - Building Flows
Answered

How to filter unique JSON data?

Like (0) ShareShare
ReportReport
Posted on 11 Nov 2021 11:52:06 by 313

Hello Everyone,

I am trying to filter JSON data using one column(UniqueId).
Suppose I have this type of JSON data:

[
{Name: "User1", UniqueId: "UID1"},
{Name: "User2", UniqueId: "UID2"},
{Name: "User3", UniqueId: "UID1"}
]

I want this JSON data to be in this form:

[
{Name: "User1", UniqueId: "UID1"},
{Name: "User2", UniqueId: "UID2"}
]

 As I already have UID1 on the 1st row, so I don't want to add any further rows with the same UniqueId.

Thanks

I have the same question (0)
  • takolota1 Profile Picture
    4,933 Moderator on 09 Jun 2023 at 00:23:19
    Re: How to filter unique JSON data?

    New more efficient template for getting unique JSON records based on set columns / fields here: https://powerusers.microsoft.com/t5/Power-Automate-Cookbook/Get-Unique-Records/td-p/2191533

  • Verified answer
    v-xiaochen-msft Profile Picture
    on 12 Nov 2021 at 01:59:20
    Re: How to filter unique JSON data?

    Hi @sayyedkohler ,

     

    I did a test for you.

    vxiaochenmsft_0-1636682151975.png

    vxiaochenmsft_1-1636682187345.png

    item().UniqueId
    vxiaochenmsft_2-1636682220302.png
    union(body('Select'),body('Select'))
    vxiaochenmsft_3-1636682281604.png

    1.

    item().UniqueId
     
    2.
    items('Apply_to_each').UniqueId
     
    3.
    body('Filter_array')[0]
     
    vxiaochenmsft_4-1636682318634.png

     

    vxiaochenmsft_5-1636682346669.png

     

    Best Regards,

    Wearsky

     

     

  • MarvinBangert Profile Picture
    1,922 Most Valuable Professional on 11 Nov 2021 at 16:48:38
    Re: How to filter unique JSON data?

    Hey @sayyedkohler 

    did you try to use the action "Filter array"? Your data is in an array format, so you should be able to filter this with this action.

     

    Does this help you? Otherwise please give me some more information.

    Best regards
    Marvin

    If you like this post, give a Thumbs up. If it solved your request, Mark it as a Solution to enable other users to find it.

    Blog: Cloudkumpel

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

Responsible AI policies

As AI tools become more common, we’re introducing a Responsible AI Use…

MS.Ragavendar – Community Spotlight

We are honored to recognize Ragavendar Swaminatha Subramanian as our September…

Leaderboard > Power Automate

#1
Michael E. Gernaey Profile Picture

Michael E. Gernaey 736 Super User 2025 Season 2

#2
Tomac Profile Picture

Tomac 396 Moderator

#3
Power Apps 1919 Profile Picture

Power Apps 1919 339

Last 30 days Overall leaderboard