I am importing data from Power Vİrtual Agents to Excel via Power Automate. I need to keep the data last row in Excel the varriable. Excel is dynamically updated. I want to get last row in Excel. I have an Excel file. It has 3 column in a table. I want to get the last row of which is the column I want. But unfortunately I couldnt it. I need help about that. I want to take columns in the last row and compare them. These data are date and time.
My second question is that there is date and time data in the cell i will import from excel. Can I compare the sizes of this data?
Thanks. but its not enough for me. Because I want to take a row in the which column i want. And i take an error (invalid expression) about this expression last(outputs('List_rows_present_in_a_table')?['body/value']). I dont understand that if I choose "List rows present in a table", how i take last row the column I want. My table has 3 column. Last row is dynamically updated. I will use this value for next step.
Hi @mertyuksel
To fetch the last row in excel sheet, pls check out the below sample.
Input excel sheet used for the below example:
Use "List rows present in a table" action to get the rows from the excel sheet:
Next, add "Compose" action and using expression we will fetch the last row in the table. Expression needs to be written in the expression box as highlighted below:
Expression used for getting the last record:
if(greater(length(outputs('List_rows_present_in_a_table')?['body/value']),0),last(outputs('List_rows_present_in_a_table')?['body/value']),null)
If there are no record, then the expression will return null value.
Output:
If this helps & solves your problem, please remember to give a 👍 and accept my solution as it will help others in the future.
Thanks
WarrenBelz
146,776
Most Valuable Professional
RandyHayes
76,287
Super User 2024 Season 1
Pstork1
66,093
Most Valuable Professional