cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
RJF61
Post Patron
Post Patron

Using Value from Previous SharePoint List Row

Hello,

I have a fleet of vehicles where I need to track mileage and inspections.  I have created a SharePoint List for current information data entry; however, I need a previous mileage field to fill based on the Vehicle ID.  I then want to identify the miles driven betwenn those dates for each record.  Following is an example...

 

DateVehicleCurrentMileagePastMileageMileageDiff
8/15100100009800200
8/151011200011900100
8/161001020010000200
8/171001035010200150
8/161011225012000250

 

My original thought was to have (2) Lists.  One list is a list of vehicles (VehicleList).  The second is the inspection (VehicleInsp).  I was then going to create a Flow that identifies the PastMileage from the VehicleList and update a field in the VehicleInsp.  Subtract the PastMileage from the CurrentMileage and then update the PastMileage (in the VehicleList) with the CurrentMileage entered for the inspection.

 

Is that the best method to achieve my results or are there more efficient options?

2 REPLIES 2
ScottShearer
Super User
Super User

@RJF61 

Use a Get changes for an item or file action and check to see if the CurrentMileage has changed.  If so, I suggest getting the current mileage value from the last version of the list item and updating the PastMileage column.  Here is a blog post that explains how.

You can use a SharePoint calculated column for the mileage difference or you can do the math in your Flow.

Let me know if you need additional help.

 

If I have answered your question, please mark your post as Solved.
If you like my response, please give it a Thumbs Up.

Scott

@ScottShearer 

Thanks for the response...still learning Power Automate and SharePoint!

RJF61_1-1660835416214.png

I have worked to create a Flow based on the Blog/link you provided.  Based on the sample data above I'm still not clear on the process.

RJF61_2-1660835634411.png

My questions...

1.  The "Blog Flow" appears to work only when a record is modified.  In my case, New records will be the typical process.  Do I need Flows Steps in the "Yes" branch for new records?

2.  I did some review of the Get Changes action.  Typically I found that it was associated with a different Trigger (When an item or file is modified).  Where would that action/process fit in the "Blog Flow"?

 

Thanks,

Randy

 

 

 

Helpful resources

Announcements
Microsoft 365 Conference – December 6-8, 2022

Microsoft 365 Conference – December 6-8, 2022

Join us in Las Vegas to experience community, incredible learning opportunities, and connections that will help grow skills, know-how, and more.

Difinity Conference 2022

Difinity Conference 2022

Register today for two amazing days of learning, featuring intensive learning sessions across multiple tracks, led by engaging and dynamic experts.

European SharePoint Conference

European SharePoint Conference

The European SharePoint Conference returns live and in-person November 28-December 1 with 4 Microsoft Keynotes, 9 Tutorials, and 120 Sessions.

Users online (1,771)