Is there a way to update the previous record in same table?

  • 0
  • 1
  • Question
  • Updated 7 months ago
  • Answered
Hi everyone,

Is there a way to modify the previous record in the same table?

I want to modify some fields of the previous record whenever we create a new record.

Any idea?

Thanks,
Gaurav
Photo of Gaurav Sharma, Certified Builder and Expert

Posted 7 months ago

  • 0
  • 1
Run an Automation triggered on new record creation that applies to max (max [rid]) -1 ?
Photo of Ken Casser

Ken Casser

  • 702 Points 500 badge 2x thumb
Is max[rid] a valid function?  I'm trying to use it in a formula url field and it's not working.  Does it only work in Automations?
Sorry, that comment wasn't meant to be usable code, just shorthand to communicate the gist of the idea. Mark, of course, has your detailed answer below.
You will need to set up a dummy table called like Max Record ID of the XYZ table with one and only 1 record in it.  It will be Record 1.

Then make a relationship to your details table and make the reference field on the right side be a formula field which calculates to 1. The formula will be, well , 1.

Then do a summary maximum of the [Record ID#] field and look that up down to the details table.
Photo of Ken Casser

Ken Casser

  • 702 Points 500 badge 2x thumb
Whew!  Thank you again!
Photo of Ken Casser

Ken Casser

  • 702 Points 500 badge 2x thumb
So, that'll tell you how many records are in the table, but it won't give you the actual highest Record ID#, will it?  If records have been deleted along the way those two numbers won't line up.  Is that right?
:) when you do a summary field, you can select a field to Summarize and so you will select [Record ID#]  and then choose a type of summary of  "Maximum"
Photo of Ken Casser

Ken Casser

  • 702 Points 500 badge 2x thumb
Bingo!  Thank you!