cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
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

@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 III
Super User III

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

Power Automate Video Tutorials
Frequent Visitor

@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

@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

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

Power Automate Video Tutorials

Helpful resources

Announcements
Community Conference

Power Platform Community Conference

Check out the on demand sessions that are available now!

MPA Community Blog

Power Automate Community Blog

Check out the community blog page where you can find valuable learning material from community and product team members!

Top Solution Authors
Top Kudoed Authors
Users online (7,564)