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 / Help - Duplicating Ite...
Power Automate
Suggested Answer

Help - Duplicating Items in a dataverse table

(1) ShareShare
ReportReport
Posted on by
Hi, 
 
I have a flow that runs daily for data that is within SharePoint. It initializes a variable for the Status > Gets all items from the Sharepoint List > Lists all the current rows from the dataverse table > Then initializes a variable for a Invoice Number
 
Then it a condition to check is the status in the list is the same as the variable and if the item in the sharepoint list is older or equal to 60 days ago (this condition check works) 
 
Then if both those checks are correct, it should check to see if the item is currently in the dataverse table or not, but at the moment it is not working, it is just duplicating all items in the table and keeps adding them.
 
In the condition, I am checking to see if the invoice number from the dataverse table is the same as the number in the sharepoint list, if it isn't the same it shouldnt add it into the the table but it is.
 
 
How do I compare both lists and only add in items that arent in the dataverse list? 
 
I can provide more information if needed.
Categories:
I have the same question (0)
  • Suggested answer
    Ninjasabi Profile Picture
    122 on at
    - trigger: Recurrence
      inputs:
        frequency: Day
        interval: 1
     
    - action: Initialize variable
      inputs:
        name: varStatus
        type: String
        value: "YourStatus"
     
    - action: Get items
      inputs:
        siteAddress: "YourSharePointSite"
        listName: "YourSharePointList"
     
    - action: List rows
      inputs:
        tableName: "YourDataverseTable"
     
    - action: Filter array
      inputs:
        from: "@outputs('Get_items')?['body/value']"
        where: "and(equals(item()?['Status'], variables('varStatus')), lessOrEquals(item()?['Created'], addDays(utcNow(), -60)))"
     
    - action: Apply to each
      inputs:
        items: "@outputs('Filter_array')"
      actions:

        - action: Filter array
          inputs:
            from: "@outputs('List_rows')?['body/value']"
            where: "equals(item()?['InvoiceNumber'], items('Apply_to_each')?['InvoiceNumber'])"
     
        - action: Condition
          inputs:
            condition: "@equals(length(outputs('Filter_array')), 0)"
          ifTrue:
            actions:

              - action: Add a new row
                inputs:
                  tableName: "YourDataverseTable"
                  data: {
                    "InvoiceNumber": "@items('Apply_to_each')?['InvoiceNumber']",
                    // Add other fields as needed
                  }
     
  • CU23071121-0 Profile Picture
    on at
     
    I keep getting this error on the first Filter Array

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 283

#2
David_MA Profile Picture

David_MA 256 Super User 2026 Season 1

#3
Expiscornovus Profile Picture

Expiscornovus 225 Most Valuable Professional

Last 30 days Overall leaderboard