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.
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
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
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.
Learn how to create your own user groups today!
Check out the new Power Platform Community Connections gallery!
Join us, in-person, December 7–9 in Las Vegas, for the largest gathering of the Microsoft community in the world.