cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
LuisGuzman98
Level: Powered On

Update and create new items in Sharepoint from excel file

Hello, 

 

I've been working in a flow for automating the update of a sharepoint data base. The sharepoint list should update with the data from an excel file, so

1. I gather the data for the triger 'when a new file is uploaded to a sharepoint folder' .

2. I convert that excel file data into a table, then I get the table with the 'get tables function'.

4. After that i list the rows of the excel table gathered for playing with this data. 

5. Then i filter the data gathered from the excel rows, so that the rows that are in blank do not enter the next process, just the once with data in it. 

6. Data items that do have data are filtered in order for determining if they should edit the sharepoint list item or if they should be created in the list. 

7. First for this process i use the Sharepoint 'get items' function for gathering the items that are equal to the actual excel row reviewed, I filter that this way: 

image.png

i think here could be the problem but not actually sure, I take that 'Filter Query' from a youtube video.  I like cause that way I don't analyze ALL the sharepoint items of the list. 

 

8. After that Another for each is created but for this case is a for each just for the sharepoint items gathered. In which I ask: If the Title of the sharepoint item is equal to the Excel Row Quote ID analyzed. If is is equal , then the sharepoint list should update with that value, if it's not the it should create a new item, buuut that's not happening. the flow never enters that path. 

image.png

 

 

 

 

1 ACCEPTED SOLUTION

Accepted Solutions
Community Support Team
Community Support Team

Re: Update and create new items in Sharepoint from excel file

Hi @LuisGuzman98 ,

 

Please refer to screenshot below to create the flow:

1.png

 

The expression in the Condition as below:

length(body('Get_items')?['value'])

Please let me know if your problem could be solved.

 

Best regards,

Alice       

 

Community Support Team _ Alice Zhang
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

4 REPLIES 4
Gristy
Level 10

Re: Update and create new items in Sharepoint from excel file

Hello,

 

Your OData Query only returns the items where Title is equal to QuoteID. Therefore that path will never be entered, and the condition is pointless.

 

Leave Update Item inside the apply each.

Move the condition block outside of the for apply each either before or after the apply each it probally does not matter.

Community Support Team
Community Support Team

Re: Update and create new items in Sharepoint from excel file

Hi @LuisGuzman98 ,

 

Please refer to screenshot below to create the flow:

1.png

 

The expression in the Condition as below:

length(body('Get_items')?['value'])

Please let me know if your problem could be solved.

 

Best regards,

Alice       

 

Community Support Team _ Alice Zhang
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

LuisGuzman98
Level: Powered On

Re: Update and create new items in Sharepoint from excel file

Hey @Gristy

Yeah I see your point there, your'e totally right.

 

Thing is the condition itself depends on the get itmes function because I need the 'Title' value but that value would only be one of the IDs I already have on the excel file. 

 

I'm thinking on a way to take out those ID's that are not in the get items list. But I don't know what condition to apply by now. 

image.png

This is the order for doing it, just lacking that condition for pulling out the Excel items that are not inside the get items list.

 

Any ideas?

 

 

LuisGuzman98
Level: Powered On

Re: Update and create new items in Sharepoint from excel file

Hey @v-alzhan-msft

 

That absolutely worked!! Thanks!

 

Even though, when testing the flow actually it inserted the items to the list, but when checking the flow test status, it appeared like if the action has been skipped, that's weird because it did happened.

 

My flow uses an excel table that is created in the same flow, and because of non dynamical parameters for the 'table range' value when creating it I will always have blank items in my values, this blank items are being added to the list as well even though i tried to filter tem out this way: image.png

 

But that is not working as i expected to. Any ideas on how i could filter that for those blank items doesn't get added to the list as well? I was thinking it could be in the 'List rows Action' as well: 

image.png

 

 

 

Again, 

I really thank you for the conditioning with this one. It worked marvellously, 

Helpful resources

Announcements
thirdimage

Power Automate Community User Group Member Badge

Fill out a quick form to claim your user group badge now!

firstImage

Incoming: New and improved badges!

We've given our badges an overhaul and also added some brand new ones!

fifthimage

Microsoft Learn

Learn how to build the business apps that you need.

sixthImage

Power Platform World Tour

Find out where you can attend!

seventhimage

Webinars & Video Gallery

Watch & learn from the Power Automate Community Video Gallery!

Top Kudoed Authors (Last 30 Days)
Users online (4,747)