cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
RobinV86
Helper I
Helper I

Get last row in Excel table with data in it

I have an excel table with about 2000 rows. Only about 1530 are in use. Everytime we start a new project, we fill in a new line using a VBA script. This spreadsheet is uploaded to a sharepoint list automatically to further tie in with other workflow tools. 

 

Uploading the entire sheet through flow takes about 30 minutes. I want to build a script that only uploads the last line (so a new project) every time the excel file is changed. This will be a lot faster. 

 

How would I set up flow so it would only create a new item for the last row in the table that has data in it? 

 

Can I do this using one of the settings in the List rows present in a table  the Filter Query box? Or by putting an expression in the top count/skip count? 

 

 

 

 

1 ACCEPTED SOLUTION

Accepted Solutions
v-bacao-msft
Community Support
Community Support

Hi @RobinV86 ,

 

You could get the data of the last row by the following method.

  • Configure List rows present in a table to get all the records.
  • Use last() function to get the last row:

Expression:

last(body('List_rows_present_in_a_table')?['value'])

32.PNG

In order to facilitate the reference data, we also could to configure the following steps.

Run the Flow in the above configuration, copy the contents contained in Compose's Outputs, and paste it in Parse JSON action.

30.PNG31.PNG

This makes it easy to use the last line of data.

34.PNG

Hope it helps.

 

Best Regards,

Community Support Team _ Barry
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

2 REPLIES 2
v-bacao-msft
Community Support
Community Support

Hi @RobinV86 ,

 

You could get the data of the last row by the following method.

  • Configure List rows present in a table to get all the records.
  • Use last() function to get the last row:

Expression:

last(body('List_rows_present_in_a_table')?['value'])

32.PNG

In order to facilitate the reference data, we also could to configure the following steps.

Run the Flow in the above configuration, copy the contents contained in Compose's Outputs, and paste it in Parse JSON action.

30.PNG31.PNG

This makes it easy to use the last line of data.

34.PNG

Hope it helps.

 

Best Regards,

Community Support Team _ Barry
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

v-bacao-msft
Community Support
Community Support

Hi @RobinV86 ,

 

Specific configuration process:

 

7890.gif

 

Best Regards,

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

Helpful resources

Announcements
MPA_User Group Leader_768x460.jpg

Manage your user group events

Check out the News & Announcements to learn more.

V3_PVA CAmpaign Carousel.png

Community Challenge - Giveaways!

Participate in the Power Virtual Agents Community Challenge

Carousel 2021 Release Wave 2 Plan 768x460.jpg

2021 Release Wave 2 Plan

Power Platform release plan for the 2021 release wave 2 describes all new features releasing from October 2021 through March 2022.

R2 (Green) 768 x 460px.png

Microsoft Dynamics 365 & Power Platform User Professionals

DynamicsCon is a FREE, 4 half-day virtual learning experience for 11,000+ Microsoft Business Application users and professionals.

Top Solution Authors
Users online (1,194)