cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
Helper II
Helper II

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
Highlighted
Community Support
Community Support

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
Highlighted
Super User II
Super User II

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.

Highlighted
Community Support
Community Support

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

Highlighted
Helper II
Helper II

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?

 

 

Highlighted
Helper II
Helper II

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
Power Platform ISV Studio

Power Platform ISV Studio

ISV Studio is designed to become the go-to Power Platform destination for ISV’s to monitor & manage published applications.

Upcoming Events

Experience what’s next for Power Automate

See the latest Power Automate innovations, updates, and demos from the Microsoft Business Applications Launch Event.

Community Conference

Power Platform Community Conference

Find your favorite faces from the community presenting at the Power Platform Community Conference!

Top Solution Authors
Top Kudoed Authors
Users online (8,807)