Hi All,
I am trying to create items ins Sharepoint List from Excel Online Business (saved in document library).
Below are the screenshots. I was able to run the flow. Problem is, when the flow runs, instead of adding only the new rows from excel, it is creating all the rows available in excel repeatedly. Not sure what is the logic i should use to stop the repetition of the items from excel.
I want to create new items in the sharepoint list whenever there are new items added in excel online.
Request some help 😞 on this.
Thanks
Sasidhar
Solved! Go to Solution.
Hi @sasidhar_mudra ,
Assuming the Employee ID is a field with a unique value in the Excel table, you can consider using the following method to configure your Flow.
Use Filter Query to filter out items that already have the same Employee ID, and if not, create a new item.
Image reference:
Best Regards,
Hi,
I think the easiest way is to have a unique field in your excel file (like an ID/name or something like that).
And also to have this unique field marked as unique in your SharePoint list. When your flow will try to add an existing item the unique field property won't let it. This will generate an "error" in your flow because it's trying to add someting that already exists but it will not interfear with the records that don't exist. If I use this method I usually add a compose as an after action that will catch the errors (use it as a run after in case of unsucces).
Another way you could do this is to also list the records from the list and compare if an ID from Excel does not exists in your list, add it and so on.
Hope this will help you 🙂
Delia
Thanks. I enforced unique values in SP list and i was able to save the list with same as excel items. As you mentioned, the flow failed when i run it again.
Since I am not from the technical backgroud, i would request you to let me what to compose to catch errors and let the flow run successfully.
On the alternative, how do i compare ID from excel to SP list?
Apologies, if i am asking too much
Thanks
Sasidhar
Hi,
1. If you use the first approach after the Create item add a new action called Compose and configure it like that:
This solution is a bit tricky because the Creat item may fail for various reasons. (like SP connection fails).
I reccomend to use the second option, it's safer.
2. To compare them you could do something like this:
In this case, you have 2 foreach loops (one to parse the Excel table and one for the SP list). These verify if the current item form Excel macthes the current item from SharePoint list.
If you have large amount of data you should not bring the entire SP list and only the item that interest you using the Filter Query inside Get items:
If the item does not exist in your SP list "Get Item" usually respond with an empty array.
In this case you have to modify the Condition to make it verify if the the item exist or not in the SharePoint list. You could measure the array length or something like that.
Hope this helps you 🙂
Delia
Thanks for the response. I did try your input. However, i do not see the SP list updating. I believe i am missing something here.
Screenshots for reference.
Thanks
Sasidhar
Hi,
You should create the item when the condition is false (when the id from the excel is not found in SP list).
If the IDs are matching means that the item is found in your list therefore the unique rule will not let you added.
Just move the Create item to If no branch and it should work 🙂
Thanks,
Delia
Hi @sasidhar_mudra ,
Assuming the Employee ID is a field with a unique value in the Excel table, you can consider using the following method to configure your Flow.
Use Filter Query to filter out items that already have the same Employee ID, and if not, create a new item.
Image reference:
Best Regards,
Hi Delia,
I changed the create item condition to NO. Though the flow ran successfully, the SP list has not been updated after i ran the flow.
I tried the other way from other response and it worked for me 🙂
I would like to appreciate and thank you for the kind support. I was able to come half way through with the flow because of you.
Regards
Sasidhar
Barry,
The solution you provided worked really well for me and sorted the issue i was struggling for two days.
Thanks a lot 🙂
Regards
Sasidhar
Dive into the Power Platform stack with hands-on sessions and labs, virtually delivered to you by experts and community leaders.
Watch Nick Doelman's session from the 2020 Power Platform Community Conference on demand!
User | Count |
---|---|
45 | |
42 | |
37 | |
36 | |
23 |
User | Count |
---|---|
41 | |
31 | |
28 | |
28 | |
27 |