Hi, so I have created a flow with the aim, after a form has been submitted the flow will scan an excel sheet and if there is already data matching a value then it will only update the row rather than creating a new row and if the data did not exist it will add a new row to the table. I managed to run this successfully on my first try with the row update but I try to test with no previous information in the table the flow failed and I realised I had an incorrect field.
I fixed this and changed the flow to suit more correctly but now the apply to each will run several times adding a new duplicate rows and adding to an existing row if the information is already there.
The duplicate rows will also create if there is no information already present in the table.
I am rather new to power automate and it may be something very obvious that I have done to replicate the apply to each as in principle the flow works as intended but the excess data being created will eventually be a problem when implement the full flow.
Likewise if data is present in the flow the apply to each running several times with one of the runs is correct, where it updates the row rather than adding a row but the other 8 runs do not update and add 8 dublicate rows.
Any help will be greatly appreciated and any more information I will try my best and update you.
Thanks
Ben
Solved! Go to Solution.
Hi @bengerry77 ,
The cause of this problem is:
1. The data submitted by the form will be compared with all the data in excel
2. For each comparison, update if they are the same, and create a new one if they are different.
This results in the creation of duplicate data
Please try to use filter query to filter excel,
If there is such a record, the length of the return value is greater than 0, then update this record
If there is no record, the return value length is equal to 0, then create a new record
Here is a test for your reference:
Here is excel:
Here is flow:
Here is result:
Add a new row:
Update a row:
Best Regards
Cheng Feng
Hi @bengerry77 ,
The cause of this problem is:
1. The data submitted by the form will be compared with all the data in excel
2. For each comparison, update if they are the same, and create a new one if they are different.
This results in the creation of duplicate data
Please try to use filter query to filter excel,
If there is such a record, the length of the return value is greater than 0, then update this record
If there is no record, the return value length is equal to 0, then create a new record
Here is a test for your reference:
Here is excel:
Here is flow:
Here is result:
Add a new row:
Update a row:
Best Regards
Cheng Feng
Hi Cheng Feng, thanks very much for the insight, I will try this now this morning and report back to you.
Cheers
Ben
Hi Cheng, once I modified the cells to suit mine it worked like a charm.
Thanks again, I now even have a better understanding of how its working and the different opperators I can use.
Thanks
Ben
User | Count |
---|---|
26 | |
13 | |
12 | |
8 | |
8 |
User | Count |
---|---|
49 | |
29 | |
23 | |
20 | |
20 |