# How to Automatically Update Previous row value

**URL:** <https://community.glideapps.com/t/how-to-automatically-update-previous-row-value/80575>\
**Category:** Ask for Help\
**Created:** [March 7, 2025, 8:55pm UTC](https://community.glideapps.com/t/how-to-automatically-update-previous-row-value/80575 "2025-03-07T20:55:06Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![scotfield123](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/scotfield123/32/62356_2.png) [@scotfield123](https://community.glideapps.com/u/scotfield123)\
**Post date:** [March 7, 2025, 8:55pm UTC](https://community.glideapps.com/t/how-to-automatically-update-previous-row-value/80575/1 "2025-03-07T20:55:06Z")

</div>

Hi everyone,

I’m building a **Crane Log** app in Glide, where users from multiple sites and cranes need to log their start and end times for each lift they do with the crane. I’m trying to automate the following process:

1. **When a user completes a crane log** , the system should create a new row with the status **“Available to Start”** after the **End Time** of the completed log.
2. **When the user starts a new log** , the **End Time** of the previous **“Available to Start”** row should be updated to the **Start Time** of the new log.

Here’s the problem:

- I need to ensure that the **“Available to Start” row** is updated **only for the current user and site** (for example, for “Site A - John Doe”), not for all users or sites.
- Glide’s **Relation** column lets me find logs for a specific user and site, but I’m struggling to automatically update the **End Time** of the **“Available to Start”** row for each user/site combination.

I’ve tried using a combination of **Relations** and **Actions** , but I’m unsure how to correctly filter the rows and trigger the updates.

**What I need help with:**

- How to **find the last “Available to Start” row** based on the user and site.
- How to **update the End Time** of the correct “Available to Start” row when the user starts a new log.

Any insights or solutions to achieve this would be greatly appreciated!

Thank you in advance for your help!

---

<div class="post-metadata">

**Author:** ![ThinhDinh](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/thinhdinh/32/49_2.png) [@ThinhDinh](https://community.glideapps.com/u/ThinhDinh)\
**Post date:** [March 7, 2025, 11:53pm UTC](https://community.glideapps.com/t/how-to-automatically-update-previous-row-value/80575/2 "2025-03-07T23:53:40Z")

</div>

Assuming you have a structure like this in your Users table.

| RowID | Username | Site name |
| --- | --- | --- |
| U001 | John Doe | Site A |
| U002 | James Doe | Site B |

Then you can do a query to your logs table, filtering out the last row that matches the user name and the site name. This might require an extra single value column that takes the “whole row” value for the last row.

Then, as the user clicks “complete”, you will set the current time to the “End Time” of that row, and add a new row with the status being “Available to Start” and set the current time to the “Start Time” of that row.

Though, what would happen if they end their shift on that day? Wouldn’t that start time be incorrect if they start their next shift on the next work day?

---

<div class="post-metadata">

**Author:** ![scotfield123](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/scotfield123/32/62356_2.png) [@scotfield123](https://community.glideapps.com/u/scotfield123)\
**Post date:** [March 8, 2025, 7:22am UTC](https://community.glideapps.com/t/how-to-automatically-update-previous-row-value/80575/3 "2025-03-08T07:22:49Z")

</div>

Thank you very much @ThinhDinh, I apreciate your help. I will do that.  
You are right about the last log of the day, it will show me available all night. Do you see any fix for this?

---

<div class="post-metadata">

**Author:** ![ThinhDinh](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/thinhdinh/32/49_2.png) [@ThinhDinh](https://community.glideapps.com/u/ThinhDinh)\
**Post date:** [March 8, 2025, 7:43am UTC](https://community.glideapps.com/t/how-to-automatically-update-previous-row-value/80575/4 "2025-03-08T07:43:41Z")

</div>

Do you have a “Start” button for those users?

---

<div class="post-metadata">

**Author:** ![scotfield123](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/scotfield123/32/62356_2.png) [@scotfield123](https://community.glideapps.com/u/scotfield123)\
**Post date:** [March 8, 2025, 7:55am UTC](https://community.glideapps.com/t/how-to-automatically-update-previous-row-value/80575/5 "2025-03-08T07:55:23Z")

</div>

I don’t think i understand your question but I’ll show you how it looks and what it does.

 ![1000011420](https://us1.discourse-cdn.com/flex002/uploads/glideapps/original/3X/9/0/9074766bc9ea87642710474fd72999065b2debc3.jpeg)  
 ![1000011421](https://us1.discourse-cdn.com/flex002/uploads/glideapps/original/3X/1/7/17d8d9d77e458628d8afdb2a6ee2baf40878ae81.jpeg)  
 ![1000011422](https://us1.discourse-cdn.com/flex002/uploads/glideapps/original/3X/7/a/7aafcffccd858831203855234b39398f8cb79dfa.jpeg)

---

<div class="post-metadata">

**Author:** ![ThinhDinh](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/thinhdinh/32/49_2.png) [@ThinhDinh](https://community.glideapps.com/u/ThinhDinh)\
**Post date:** [March 8, 2025, 10:50pm UTC](https://community.glideapps.com/t/how-to-automatically-update-previous-row-value/80575/6 "2025-03-08T22:50:47Z")

</div>

So wouldn’t you just need to not set the start time ahead of time?

Like you can allow them to submit that form, and only when they submit that form, you record the start time as the “current” time?
