cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
RJF61
Helper III
Helper III

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
 WHAT’S NEXT AT MICROSOFT IGNITE 2022

WHAT’S NEXT AT MICROSOFT IGNITE 2022

Explore the latest innovations, learn from product experts and partners, level up your skillset, and create connections from around the world.

Register for a Free Workshop.png

Register for a Free Workshop

Learn to digitize and optimize business processes and connect all your applications to share data in real time.

September Events 2022

Check out all of these events

Attend in person or online, there are incredible conferences and events happening all throughout the month of September.

Users online (1,955)