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

Notifications

Announcements

Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Automate / Excel add and update r...
Power Automate
Suggested Answer

Excel add and update rows via automate

(0) ShareShare
ReportReport
Posted on by 51

Excel list rows via automate to add or update row

Hi all

 

I have an automation recurring to list rows from

Source and list rows in destination file

 

I have apply to each body value, filter array based on key matching key from each table

 

Then compose outputs

 

Condition is based on length key equal 0

 

Then add row or update rows

 

However it Is running successfully but only seems to add some rows Or not at all

 

Both files on SharePoint

 

Sometimes it’s successful But nothings happening?!

 

Can you assist? Kindly please

Categories:
I have the same question (0)
  • rzaneti Profile Picture
    4,249 Super User 2025 Season 2 on at
     
    Could you please share an image of your flow design, including your inputs for Filter array and Condition? Also, share an image of one of these flow runs where "something is successful, but nothing is happening", including the raw outputs from Filter array, so we can see how Power Automate is reading your data.
     
    Let me know if it works for you or if you need any additional help!
     
    If this is the answer to your question, please mark the post as Accepted Answer.
    If this answer helps you in any way, please give it a like.

    Check more Power Platform content on my website.
    Lets connect on LinkedIn.
  • bB-27090143-0 Profile Picture
    51 on at
    Look at the outputs on the filter array, it doesn't seem to be comparing like for like?
     
     
  • Suggested answer
    rzaneti Profile Picture
    4,249 Super User 2025 Season 2 on at
    Hi,
     
    I get I found your problem. The column to be filtered in both Excel files (source and destination) has the same name: SubmissionID. In your Filter array, you are referencing this column with the item() function (in red):  
     
     
     
    There is a trick here, however. In general, when you use an item() function in any action inside a loop, it references the currently iterated array item. But there are a few exceptions for it, which is the case of the actions Select and Filter array, for example. When you use the item() function inside a Filter array, it points to the array items contained in the array to be filtered, and not to the looped array in the For each. It means that your both entries for the Filter array are pointing to the same place: the Filter array element, as highlighted in red.
     
    Solution: replace your second Filter array input for the dynamic content of Current item of your loop (like below), or for the expression items('Comparing-both-tables').
     
     
    Let me know if it works for you or if you need any additional help!
     
    If this is the answer to your question, please mark the post as Accepted Answer.
    If this answer helps you in any way, please give it a like.

    Check more Power Platform content on my website.
    Lets connect on LinkedIn.
     
  • bB-27090143-0 Profile Picture
    51 on at
    Thank you I think this is it but the dynamic expressions are not giving me the options
     
    I don't have a second filter array
     
    Should I have one inside the update loop?
    {
      "type": "Foreach",
      "foreach": "@outputs('List_rows_present_in_a_table-Source')?['body/value']",
      "actions": {
        "Filter_array": {
          "type": "Query",
          "inputs": {
            "from": "@outputs('List_rows_present_in_a_table-Destination')?['body/value']",
            "where": "@equals(item()?['Key'],item()?['Key'])"
          }
        },
        "Compose": {
          "type": "Compose",
          "inputs": "@body('Filter_array')?[0]?['Key']",
          "runAfter": {
            "Filter_array": [
              "Succeeded"
            ]
          }
        },
        "Condition": {
          "type": "If",
          "expression": {
            "and": [
              {
                "equals": [
                  "@length(body('Filter_array'))",
                  0
                ]
              }
            ]
          },
     
     
     
     
    Are you advising to change to this???
     
    {
      "type": "Query",
      "inputs": {
        "from": "@outputs('List_rows_present_in_a_table-Destination')?['body/value']",
        "where": "@equals(item()?['Key'],items('Apply_to_each'))"
      }
    }
  • rzaneti Profile Picture
    4,249 Super User 2025 Season 2 on at
     
    Exactly! Your Code view from Filter array inside the loop must look similar to this, where the first element from the equals function in "where" property is item() (eventually followed by a property between square brackets, like the "Key" in your last message) and the second is items('Apply_to_each'), which references the currently iterated item in your array:
     
     
    Let me know if it works for you or if you need any additional help!
     
    If this is the answer to your question, please mark the post as Accepted Answer.
    If this answer helps you in any way, please give it a like.

    Check more Power Platform content on my website.
    Lets connect on LinkedIn.
     
     

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

Forum hierarchy changes are complete!

In our never-ending quest to improve we are simplifying the forum hierarchy…

Ajay Kumar Gannamaneni – Community Spotlight

We are honored to recognize Ajay Kumar Gannamaneni as our Community Spotlight for December…

Leaderboard > Power Automate

#1
Michael E. Gernaey Profile Picture

Michael E. Gernaey 525 Super User 2025 Season 2

#2
Tomac Profile Picture

Tomac 324 Moderator

#3
abm abm Profile Picture

abm abm 232 Most Valuable Professional

Last 30 days Overall leaderboard