cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Newuser01
New Member

Duplicate copes created

Hello,

 

I created a form and and SharePoint site list. My goal is to input all my responses into a SharePoint list and take the answers of my form and populate the list I created. The issue I'm falling into is I need to have two things happen. Based on the value of one of the responses from my form I need it to either create a new item if the value is nor already in the SharePoint list, or create a duplicate item, but just add a (1) to the value of the new item created in SharePoint.

 

I used a condition that if my number value in my form matches my number value in SharePoint to do one of the two things. However in order to do this, I had to use a Apply to All control to have the values compared. It worked but now what happens is that my flow creates a new items based on the amount of items are on my SharePoint list. So if I have 4 items in my SharePoint list, it creates 4 new items. How do I have it create just one, have looking at the number value to see if there is a duplicate.

 

Any help would be greatly appreciated. 

2 REPLIES 2
Gopala_Krishna
Super User
Super User

@Newuser01 

I am not sure about the configuration of the flow that you have made, if you can share that it would be greatly appreciated.

 

Can you try using the "filter array" action to do the filtering, on the from part of the "filter array" action pass the body of the Sharepoint action that you are using to retrieve the items from the list, then build a condition to compare if the response from the form is present in the list.

 

After this add a compose action and set the expression to be 

length(body('Filter_array'))

 

Now in the next step compare this value if the value is greater than 0 it means that there are matching items if the values is not greater than 0 then there are no matching items. 

 

This would help in removing the apply to each loop and would also help in creating only a single item 

 

Gopala_Krishna_0-1617073261398.png

----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

if the information shared helps you, please consider giving a thumbs up 👍 and mark solution as resolved

Here is my current flow. As you can see, what I want to do is if my case number from my forms matches the case number in my sharepoint site. if the case number matches, it creates a new item but just adds the (1) to the number but if it does not match, it creates an entirely new item. It works but again, what I believe happens is that if because the value variable is applying to all, items in the sharepoint site, it creates double the items in the site. I was just hoping to create 1 item after seeing if there was a copy on the sharepoint site.

 

I'll give your suggestion a shot.

 

 

Newuser01_0-1617106574505.png

Newuser01_1-1617106837939.png

 

Helpful resources

Announcements
UG GA Amplification 768x460.png

Launching new user group features

Learn how to create your own user groups today!

Community Connections 768x460.jpg

Community & How To Videos

Check out the new Power Platform Community Connections gallery!

M365 768x460.jpg

Microsoft 365 Collaboration Conference | December 7–9, 2021

Join us, in-person, December 7–9 in Las Vegas, for the largest gathering of the Microsoft community in the world.

Top Solution Authors
Top Kudoed Authors
Users online (1,249)