cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
PowerNoob
Level: Powered On

Duplicates created when creating new items in SharePoint List

I have a SharePoint List that I'm trying to compare the items to an Excel spreadsheet. If an item in the Excel is not in the SharePoint List I want it to be added as a new line item.

 

Excel:

Customer

Acme

Acme Brick

 

SharePoint List

Customer

Acme

Acme inc.

 

Expected Result

Customer

Acme

Acme inc.

Acme Brick

 

The issue I'm facing is when the Flow runs it is creating 4 entries for each item in the SharePoint List

 

Actual Result:

Customer

Acme

Acme inc.

Acme Brick

Acme Brick

Acme Brick

Acme Brick

 

2019-08-08 06_57_23-Edit your flow _ Microsoft Flow.png

 

1 ACCEPTED SOLUTION

Accepted Solutions
Super User
Super User

Re: Duplicates created when creating new items in SharePoint List

@PowerNoob 

I have created an example that should work for you.

 

Please note the Query Filter in the Get Items action

I loop through each row of Excel data.

The Query Filter limits the results from Get Items to those where the Customer match the Title

If Get Items does not return a row, I create a new item.

My expression in the condition is in the comments section.

ItemFromExcel1.jpgItemFromExcel2.jpgItemFromExcel3.jpg

 

 

 

 

 

If I have answered your question, please mark your post as Solved.
If you like my response, please give it a Thumbs Up.

Scott

View solution in original post

4 REPLIES 4
Super User
Super User

Re: Duplicates created when creating new items in SharePoint List

Hi @PowerNoob ,

 

Thanks for the good explanation with examples. 

 

Looks like your loop Apply to each is wrong here.

 

After the List rows present in a table Add the Apply to each loop.

Then inside th loop add the Get Items and set the Count property to 1 with other filters.

Check the count of the result whether its zero or more than zero.

Add the next Apply to each loop under the no condition.

 

If you need anymore help let me know.

 

If this reply has answered your question or solved your issue, please mark this question as answered. Answered questions helps users in the future who may have the same issue or question quickly find a resolution via search. If you liked my response, please consider giving it a thumbs up.

 

Thanks



Did I answer your question? Mark my post as a solution!

If you liked my response, please consider giving it a thumbs up


Proud to be a Flownaut!



PowerNoob
Level: Powered On

Re: Duplicates created when creating new items in SharePoint List

@abm Thanks for the response.

 

I tried what you mentioned below or at least how I understood it and still getting the same result with multiple entries for one item2019-08-08 06_57_23-Edit your flow _ Microsoft Flow.png

Super User
Super User

Re: Duplicates created when creating new items in SharePoint List

@PowerNoob 

I have created an example that should work for you.

 

Please note the Query Filter in the Get Items action

I loop through each row of Excel data.

The Query Filter limits the results from Get Items to those where the Customer match the Title

If Get Items does not return a row, I create a new item.

My expression in the condition is in the comments section.

ItemFromExcel1.jpgItemFromExcel2.jpgItemFromExcel3.jpg

 

 

 

 

 

If I have answered your question, please mark your post as Solved.
If you like my response, please give it a Thumbs Up.

Scott

View solution in original post

Super User
Super User

Re: Duplicates created when creating new items in SharePoint List

Hi @PowerNoob  & @ScottShearer ,

 

I was about to finish an example then saw the post.

 

Thanks



Did I answer your question? Mark my post as a solution!

If you liked my response, please consider giving it a thumbs up


Proud to be a Flownaut!



Helpful resources

Announcements
thirdimage

Power Automate Community User Group Member Badge

Fill out a quick form to claim your user group badge now!

firstImage

Incoming: New and improved badges!

We've given our badges an overhaul and also added some brand new ones!

fifthimage

Microsoft Learn

Learn how to build the business apps that you need.

sixthImage

Power Platform World Tour

Find out where you can attend!

seventhimage

Webinars & Video Gallery

Watch & learn from the Power Automate Community Video Gallery!

Top Kudoed Authors (Last 30 Days)
Users online (4,896)