cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
Frequent Visitor

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
Highlighted
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
Highlighted
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!

Learn more from my blog
Highlighted
Frequent Visitor

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

Highlighted
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

Highlighted
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!

Learn more from my blog

Helpful resources

Announcements
firstImage

Now Live: Power Virtual Agents Community!

We are excited to announce the launch of Power Virtual Agents Community. Check it out now!

firstImage

New & Improved Power Automate Community Cookbook

We've updated and improved the layout and uploading format of the Power Automate Cookbook!

thirdimage

Power Automate Community User Group Member Badge

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

Top Solution Authors
Users online (8,184)