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 / Uncommon records from ...
Power Automate
Unanswered

Uncommon records from 2 array objects

(0) ShareShare
ReportReport
Posted on by 52

Hello Friends,

 

Need a help

Below is my scenarios. 

I have 2 tables

result array

appsub_appcol xcol y
app1subapp1xxyy
app1subapp2xxxyyy
app2subapp4xxxyyy
app3subapp6xy

 

                                                                       

Table 2  master table with all app sub app mapping

Master array

appsub_app
app1subapp1
app1subapp2
app1subapp3
app2subapp4
app2subapp5
app3subapp6
app3subapp7

 

I need result set like below

 

appsub_appCol xcol y
app1subapp1xxyy
app1subapp2xxxyyy
app1subapp3--
app2subapp4xxxyyy

app2

subapp5--
app3subapp6xy
app3subapp7--

 

I tried something Like below in powerflow but I cant break the  inner loop

 

1) get both tables in array objects

For items in Master array

{

             For items in result array

             {

                      if(Master array.sub_app=result array.sub_app){

                                  Flag=true;

                                  break; }

             }   

    if (Flag=false) {append in some new array }

}

 

Challenge is I can't break the loop.

Categories:
I have the same question (0)
  • Chriddle Profile Picture
    8,640 Super User 2026 Season 1 on at

    Just query your arrays with xpath:

    Chriddle_0-1702034306042.png

    Select

    From

     

    outputs('Master')

     

    Map app

     

    item()['app']

     

    Map sub_app

     

    item()['sub_app']

     

    Map col_x

     

    first(
    	xpath(
    		xml(json(concat('{"Root":{"Item":', outputs('Result'),'}}'))),
    		concat('//Item[app="',item()['app'], '" and sub_app="', item()['sub_app'], '"]/col_x/text()')
    	)
    )

     

    Map col_y

     

    first(
    	xpath(
    		xml(json(concat('{"Root":{"Item":', outputs('Result'),'}}'))),
    		concat('//Item[app="',item()['app'], '" and sub_app="', item()['sub_app'], '"]/col_y/text()')
    	)
    )

     

    Results:

     

    app sub_app col_x col_y
    app1 subapp1 xx yy
    app1 subapp2 xxx yyy
    app1 subapp3    
    app2 subapp4 xx yyy
    app2 subapp5    
    app3 subapp6 x y
    app3 subapp7    
  • manifest_aj Profile Picture
    52 on at

    Thank you.

  • manifest_aj Profile Picture
    52 on at

    Hi Chriddle,

     

    It is considering only one row in case of duplicate as below.

     

    result array

    appsub_appcol xcol y
    app1subapp1xxyy
    app1subapp2zzxxx
    app1subapp2xxxyyy
    app2subapp4xxxyyy
    app3subapp6xy

     

  • manifest_aj Profile Picture
    52 on at

    Hi Chriddle,

     

    It is considering only one row in case of duplicate as below. Highlighted in Bold.

     

    result array

    appsub_appcol xcol y
    app1subapp1xxyy
    app1subapp2zzxxx
    app1subapp2xxxyyy
    app2subapp4xxxyyy
    app3subapp6xy

     

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

    So it's basically the (sorted) "result array" with added app/subapp combinations from the Master that have no entires in result?

  • manifest_aj Profile Picture
    52 on at

    I need both. 

  • manifest_aj Profile Picture
    52 on at

    Master have all entries and result is basically some power app I designed where user can enter entries and  saved in sharepoint list

     

    but in report I have to show all entries and users who has not submitted then should appear as "No show"

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

    This flow combines "Master" and "Results", sort this new array and then identifies and filters out records from Master that are also present in Results.

    Chriddle_0-1702467909278.png

    Master

    Spoiler (Highlight to read)
    [
     {
     "app": "app1",
     "sub_app": "sub_app1"
     },
     {
     "app": "app1",
     "sub_app": "sub_app2"
     },
     {
     "app": "app1",
     "sub_app": "sub_app3"
     },
     {
     "app": "app2",
     "sub_app": "sub_app4"
     },
     {
     "app": "app2",
     "sub_app": "sub_app5"
     },
     {
     "app": "app3",
     "sub_app": "sub_app6"
     },
     {
     "app": "app3",
     "sub_app": "sub_app7"
     }
    ]
    [ { "app": "app1", "sub_app": "sub_app1" }, { "app": "app1", "sub_app": "sub_app2" }, { "app": "app1", "sub_app": "sub_app3" }, { "app": "app2", "sub_app": "sub_app4" }, { "app": "app2", "sub_app": "sub_app5" }, { "app": "app3", "sub_app": "sub_app6" }, { "app": "app3", "sub_app": "sub_app7" } ]

    Result

    Spoiler (Highlight to read)
    [
     {
     "app": "app1",
     "sub_app": "sub_app1",
     "col_x": "xx",
     "col_y": "yy"
     },
     {
     "app": "app1",
     "sub_app": "sub_app2",
     "col_x": "xxx",
     "col_y": "yyy"
     },
     {
     "app": "app1",
     "sub_app": "sub_app3",
     "col_x": "xx",
     "col_y": "yyy"
     },
     {
     "app": "app3",
     "sub_app": "sub_app6",
     "col_x": "x",
     "col_y": "y"
     },
     {
     "app": "app1",
     "sub_app": "sub_app1",
     "col_x": "xx2",
     "col_y": "yy2"
     }
    ]
    [ { "app": "app1", "sub_app": "sub_app1", "col_x": "xx", "col_y": "yy" }, { "app": "app1", "sub_app": "sub_app2", "col_x": "xxx", "col_y": "yyy" }, { "app": "app1", "sub_app": "sub_app3", "col_x": "xx", "col_y": "yyy" }, { "app": "app3", "sub_app": "sub_app6", "col_x": "x", "col_y": "y" }, { "app": "app1", "sub_app": "sub_app1", "col_x": "xx2", "col_y": "yy2" } ]

    CommbinedWithSortKey (Select)

    From

     

     

     

    union(outputs('Master'), outputs('Result'))

     

     

     

    Map Item

     

     

     

    item()

     

     

     

    Map SortKey

     

     

     

    concat(item()['app'], decodeUriComponent('%0A'), item()['sub_app'])

     

     

     

     

    SortedCombined (Compose)

     

    sort(body('CombinedWithSortKey'), 'SortKey')

     

     

     

     

    MarkedItems (Select)

    From

     

    range(0, length(outputs('SortedCombined')))

     

    Map app

     

    outputs('SortedCombined')[item()]['Item']['app']

     

     

     

     Map sub_app

     

    outputs('SortedCombined')[item()]['Item']['sub_app']

     

     

     

    Map col_x

     

    if(
    	less(
    		item(),
    		sub(length(outputs('SortedCombined')), 1)
    	),
    	if(
    		equals(
    			outputs('SortedCombined')[item()]['Item']?['col_x'],
    			null
    		),
    		if(
    			and(
    				equals(
    					outputs('SortedCombined')[item()]['Item']['app'],
    					outputs('SortedCombined')[add(item(), 1)]['Item']['app']
    				),
    				equals(
    					outputs('SortedCombined')[item()]['Item']['sub_app'],
    					outputs('SortedCombined')[add(item(), 1)]['Item']['sub_app']
    				)
    			),
    			'deleteme',
    			outputs('SortedCombined')[item()]['Item']?['col_x']
    		),
    		outputs('SortedCombined')[item()]['Item']?['col_x']
    	),
    	outputs('SortedCombined')[item()]['Item']?['col_x']
    )

     

     

     

    Map col_y

     

    outputs('SortedCombined')[item()]['Item']?['col_y']

     

     

    FilteredItems (Filter array)

    From

     

    body('MarkedItems')

     

     

     

    Filter

     

    @not(equals(item()['col_x'], 'deleteme'))

     

     

    Output table:

    app sub_app col_x col_y
    app1 sub_app1 xx yy
    app1 sub_app1 xx2 yy2
    app1 sub_app2 xxx yyy
    app1 sub_app3
    app2 sub_app3 xx yyy
    app2 sub_app4
    app2 sub_app5
    app3 sub_app4 x y
    app3 sub_app6
    app3 sub_app7

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

Haque 304

#2
David_MA Profile Picture

David_MA 245 Super User 2026 Season 1

#3
Expiscornovus Profile Picture

Expiscornovus 243 Most Valuable Professional

Last 30 days Overall leaderboard