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

Update last line in Excel

Hi there,

 

How can I update the last row in an Excel table if several row are the same?

 

2019-05-23_17-54-00.jpg 

last(body('In_Tabelle_vorhandene_Zeilen_auflisten')?['value'])?['DATUM']
 
This will not be the last date on the last row but the first last date
2019-05-23_18-09-32.jpg
 
It would be great if someone can help me with this.
 
Best regard
 
1 ACCEPTED SOLUTION

Accepted Solutions
Dual Super User
Dual Super User

Re: Update last line in Excel

@RayRay 

So, you do not need the last row, but the last row with any value assigned to column "ENDE", right?

I also assume body('In_Tabelle_vorhandene_Zeilen_auflisten')?['value'] is the output of a 'List rows present in a table' action block, right?

If so, there is an excellent explanation on how to proceed in the following post

https://powerusers.microsoft.com/t5/Building-Flows/Flow-that-checks-for-empty-cells-within-an-excel-...

Please note the scenario descirbe in the post :

-is more complex than yours, in you case I guess it is enough to add the "Filter array" action block just after "List rows present in a table"

-assumes the opposite, i.e. the expression on the Filter Array described in the post [ equals(empty(item()?['date']), bool('True')) ] gets all rows with column 'date' empty, but you want to get all rows with column 'ENDE' not empty, so you will need something like [ not(equals(empty(item()?['ENDE']), bool('True'))) ]

Once you have all rows with column 'ENDE' not empty, you can apply last() expression to the output of 'Filter array' action block

 

Hope this helps

 





If anyone is trying to help you with an issue, the fastest way to say thanks is by kudoing. Be grateful, Thumbs up!

Proud to be a Flownaut!





View solution in original post

2 REPLIES 2
Dual Super User
Dual Super User

Re: Update last line in Excel

@RayRay 

So, you do not need the last row, but the last row with any value assigned to column "ENDE", right?

I also assume body('In_Tabelle_vorhandene_Zeilen_auflisten')?['value'] is the output of a 'List rows present in a table' action block, right?

If so, there is an excellent explanation on how to proceed in the following post

https://powerusers.microsoft.com/t5/Building-Flows/Flow-that-checks-for-empty-cells-within-an-excel-...

Please note the scenario descirbe in the post :

-is more complex than yours, in you case I guess it is enough to add the "Filter array" action block just after "List rows present in a table"

-assumes the opposite, i.e. the expression on the Filter Array described in the post [ equals(empty(item()?['date']), bool('True')) ] gets all rows with column 'date' empty, but you want to get all rows with column 'ENDE' not empty, so you will need something like [ not(equals(empty(item()?['ENDE']), bool('True'))) ]

Once you have all rows with column 'ENDE' not empty, you can apply last() expression to the output of 'Filter array' action block

 

Hope this helps

 





If anyone is trying to help you with an issue, the fastest way to say thanks is by kudoing. Be grateful, Thumbs up!

Proud to be a Flownaut!





View solution in original post

v-zhos-msft
Level 10

Re: Update last line in Excel

Hi @RayRay ,

I have made some tests on my side. It has the same issue as yours.

As the pic shown, the value of row 23, 24 25 are same.

So when you enter the last 'DATUM' value in the 'Key value' field to update the row 25, but actually, the flow is get the row 23 to update.

As you can see, you need use the 'Key column' and 'Key value' to get the specific row in the 'Update a row' action .

Capture.PNG

So if there are several same rows, it will update the top one.

So I am afraid you need create another column here to enter different value to distinguish each row.

Best Regards,

Community Support Team _ Zhongys

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

 

Helpful resources

Announcements
firstImage

Power Platform Online Conference

Speakers, submit your sessions now! Call for speakers ends Feb. 10!

firstImage

New & Improved Power Automate Community Cookbook

We've updated and improved the layout and uploading format of the Power Automate Cookbook!

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 Solution Authors
Top Kudoed Authors (Last 30 Days)
Users online (4,409)