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 / Power Automate flow to...
Power Automate
Unanswered

Power Automate flow to Add a row based on Rows from Another Table satisfying multiple criteria

(0) ShareShare
ReportReport
Posted on by 7

I'm working on a flow which picks the rows from two tables, it filters out data from the second table - if Status = 'Processed' in the ODATA query, subsequently this is taken as an input to Filter Array ( source is the second table again ) where the condition is to check whether any value in the Key column of the second table is present in the Unique Key column in the first table - for this I used the dynamic content from the list rows from both the tables respectively; if Key is not present in unique Key, the flow should proceed to add a row to the first Table (DemoTable in ZDemoLog). For mapping the fields I used the expression "items('Apply_to_each_2')?['Serial No.']" to map the serial number and so on. 

 

Currently, there are no rows added, and the filter array is not initiated, and just skipped.

AnuraagD_0-1705553426119.png

AnuraagD_1-1705553458699.png

 

The flow runs successfully, however there are no new rows added into the table based on the given criteria. 

 

Any help would be appreciated.

 

@ManishSolanki 

Categories:
  • v-xiaochen-msft Profile Picture
    Microsoft Employee on at

    Hi @AnuraagD ,

     

    Please try this

    vxiaochenmsft_0-1705558760923.png

    Apply to each input: outputs('List_rows_present_in_a_table_2')?['body/value']

    Filter Array input: outputs('List_rows_present_in_a_table')?['body/value']

    Filter Array left parameter: item()?['Unique Key']

    Filter Array right parameter: items('Apply_to_each')?['Key']

    Condition: length(body('Filter_array'))

     

    Best Regards,

    Wearsky

  • AnuraagD Profile Picture
    7 on at

    Will try it out and give feedback 

  • AnuraagD Profile Picture
    7 on at

    Hi, I tried out the same, it skipped when I put 

    length(body('Filter_array')) is equal to zero, so i flipped the condition to if not an empty array, i.e. doesn't contain zero. 

     

    Now it does populate the Excel and adds a row, however duplicates keep generating even though there's a key filter each time. 

     

    So I made a minor change again,  I filter the array of the first table (Line Schedule Table instead) and left the other parts the same.

    I have attached the flow below

     

    Here are the screenshots - Excel Table

    AnuraagD_0-1705561342553.png

     

    Current flow - 

    AnuraagD_1-1705561454718.png

    Is it possible that we filter out the array from the second before running through each.

     

    It does add values now though

     

  • v-xiaochen-msft Profile Picture
    Microsoft Employee on at

    Hi @AnuraagD ,

     

    I don't know why there is duplicate data.

    Since you want to add data from the second table to the first table, the traversed object should be the second table instead of the first table.

     

    Best Regards,

    Wearsky

  • AnuraagD Profile Picture
    7 on at

    Thanks though, I'll try to work something else out and update it out here should it work. I'm unable to get rid of the duplication, would you have an idea why though ?

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

Season of Sharing Community Challenge Winners!

Congratulations to our community stars!

Kudos to our 2025 Community Spotlight Honorees

Expanding mentorship, skilling, and AI innovation

Leaderboard > Power Automate

#1
Mohsin Ali Profile Picture

Mohsin Ali 299

#2
11manish Profile Picture

11manish 274 Super User 2026 Season 2

#3
Henil Profile Picture

Henil 119

Last 30 days Overall leaderboard