I have a flow that compares a form response with an excel spreadsheet. If the value exists in the spreadsheet already, the flow updates that record. Which works fine.
If the value does nOT exist in the spreadsheet, the flow adds a new record to the spreadsheet wiht the values submitted in the form.
The problem is that it does so multiple times, not just the one time as expected.
In fact it does so as many times as there are existing rows in my table!!
How can I add the row to the table only once?
@pennyland I understand this query is 2 years old but I am having same issue. I get how to do this except I want to understand your first condition to continue building my flow.
My flow is user fills in MS Form, it writes to an excel sheet. Based on region (field in the excel), the idea is to send email to appropriate person. I am currently facing the row being written twice to the excel and my 'apply to each' is going haywire and sending multiple emails (one email per row in excel, not just one based on the new row).
cc: @efialttes
THAT WORKED!!! Thank you SO MUCH!!
Hi
Move the second condition OUT of the 'Apply to each' and try again. In your current flow, it was added inside by mistake, so the result is the same as you got with your initial flow version
Hope this helps
Thank you so much for this reply.
Unfortunately i'm seeing the same exact outcome. Multiple rows are being added to the spreadsheet.
Here's the flow:
Hi
Let's assume you have 7 rows in your excel sheet, and a new forms response is received.
Your current flow iterates 7 times (row by row) due to the Apply to each.
In each iteration your flow performs an evaluation. If such evaluation succeeds, the flow updates the row under evaluation on that iteration. If such evaluation fails, the flow creates a new row on that iteration.
If no row matches your evaluation, then 7 new rows are added.
If 1 row matches your evaluation, the row is updated once, and 6 new rows are added.
I would follow a different approach.
First, initialize a boolean variable before your apply to each, lets call it 'matchingRow', you should set its value to false.
Next, inside your apply to each, under the true condition branch, you currently have 'Update a row'. Plase add 'Set variable', select 'matchingRow' and assign it true value.
NExt, remove 'Add a row into a table' from the false condition branch.
Now, just after your 'Apply to each', you should add a new condition to evaluate content of variable 'matchingRow'.
On its false branch, add the action 'Add a row into a table'.
There are probably more efficient ways to implement your requirements, but this approach should work.
Hope this helps
WarrenBelz
146,651
Most Valuable Professional
RandyHayes
76,287
Super User 2024 Season 1
Pstork1
65,999
Most Valuable Professional