Hello,
I am fairly new to the Power Platform in general, I only have used for a 2/3 months now, but I am no complete stranger to programming and designing functions and processes, though it has never been my main occupation (so be kind if I have made some rookie mistake).
Now, I have built a Flow that is integrate into a PowerApp and does the following:
- Take an item ID (contained in a Sharepoint List, that I will call "List1") and an Excel file (containing a Table with two columns: "Code", "Description") uploaded by the user from PowerApps
- Copy the Excel file to a SharePoint Document Library
- Retrieve the Table and its content from said Excel file
Then my goal is to verify that each item from the Excel file exists in a SharePoint List (lets call it "List2"), if not add it, then take its ID.
I then populate a Mapping Table linking the List1_ItemID and each List2_ItemID.
I currently do as follows:
- For each Row in the Excel I do a Get Items action filtered on the Code value
- If it is found I take its ID and create an item in the Mapping Table linking the two ID values, if not I create the Item in List2, then take its ID and make the relationship in the Mapping Table.
When everything is finished delete the Excel file an the Flow ends.
It all works well and does what it is supposed to do BUT it takes a lot of time: for an Excel file with 400 records it takes around 20min to complete.
I was wondering if I should arrange the flow differently (maybe there is a way to check items existence in a bunch instead of looping through an calling Get Items so many times) or some best practices I could implement to speed up things.
Thank you all in advance!!