Auto update multiple rows in table view after manually updating one row

Hi.

I have had a request from a colleague based on the attached screenshot. It is a Production Plan grouped by [Area] with [Start],[Duration], and [Finish] columns among others. What we are looking to do is if the user changes the [Start] for [Job Card] 000023 from 07:30 to 08:30 all subsequent values for [Start] & [Finish] (by [Area]) in this View will update by +1Hr. Notwithstanding that updating subsequent rows will only be required for those rows whose work starts after the row that is updated. e.g. if [Job Card #] 000025 was updated, only 000026 would auto update.

I would need to implement the same behaviour if the [Duration] value changed also. For example if the [Duration] on [Job Card #] 000023 changed from 4hr to 5hr then that would change the finish time to 12.30 and update all subsequent [Start] & [Finish] times by 1HR.

Hope this makes some sense. Any advice on if this is achievable and how would be greatly appreciated.

Thank you.

0 5 753
5 REPLIES 5

Youโ€™ll definitely want to be using the โ€œData: execute an action on a set of rowsโ€ Action type. This could be triggered by a workflow that triggers upon the change of the first record.

I think youโ€™ll have a few different options to accomplish this, depending on your exact requirements. Iโ€™m thinking youโ€™ll have a much easier time if you can limit the adjustments to just +/- 1 hour, or +/- 1/2 hour.

Check out this sample app:
https://www.appsheet.com/samples/This-app-shows-how-to-use-reference-actions?appGuidString=e76d2e73-...

Hi @Marc_Dillon

I have implemented your suggestion based on the sample app. Hopefully this will suffice. Thanks so much for your assistance.

Hi

I may have been a little presumptuous saying I have this working. I found a small issue in testing. The issue I am having is getting the [Duration] functionality working. As per above โ€˜if the [Duration] on [Job Card #] 000023 changed from 4hr to 5hr then that would change the finish time to 12.30 and update all subsequent [Start] & [Finish] times by 1HR.โ€™ [Finish] is currently a formula so that will update correctly based on the [Duration] & [Start] so actually no need to factor this in really.

  • I created a โ€˜Set the values of some columns in this rowโ€™ and set [Duration] to [Duration]+โ€œ000:15:00โ€ and [Start] to [Start]+โ€œ000:15:00โ€ to increment in 15 min intervals.

  • My โ€˜Only if this condition is trueโ€™ expression needs to update the existing rowโ€™s [Duration] & [Finish] and all subsequent [Start] & [Finish] values. Do I need to create an additional โ€˜Set the values of some columns in this rowโ€™ action, group them and select that grouped action as the Reference action below?

The reason I ask is because I think I can only achieve my requirement with 2 different โ€˜Only if this condition is trueโ€™ expressions. One to increment the current rowโ€™s duration and another to ignore the current rowโ€™s [Start] but update all subsequent [Start]s.

I just canโ€™t seem to get those expressions right because what is happening is all [Duration]s are updating by 15 mins and none of the subsequent [Start] times are updating.

My โ€˜Execute an action on a set of rowsโ€™ action is created with a Referenced Row expression
FILTER(โ€œRoutings_Masterโ€,
AND(
[Routing Date]=[_THISROW].[Routing Date],
[Department]=[_THISROW].[Department],
[Equipment / Area]=[_THISROW].[Equipment / Area]
))

Referenced action as per above.

My โ€˜Only if this condition is trueโ€™ expression is [Status]=โ€˜In Productionโ€™

Could you maybe advise if I am on the right track and what expression(s) might help to achieve what I need?

Many thanks.

Maurice.

Nice work, sounds like youโ€™re very close.

Hereโ€™s what Iโ€™d do:

Sounds like youโ€™ll want 2 visible buttons for the user;

  1. โ€œadd 15min to start timeโ€
  2. โ€œadd 15 min to durationโ€.
    These will both be โ€œGroupedโ€ actions.

Additionally Iโ€™d create 2 โ€œset values of columnsโ€ actions;
3. [Start] = [Start] + 15
4. [Duration = [Duration] + 15

  1. Then the 1 โ€œexecute an action on a set of rowsโ€
    I think your referenced rows FILTER() is correct, but possibly you need to add one more condition to the AND() to only increment records after the one being edited.
    This action will trigger #3 action from above.

Visible โ€œgroupedโ€ Action #1 will run #3 and #5.
Visible โ€œgroupedโ€ Action #2 will run #4 and #5.

Iโ€™m not sure what youโ€™re getting at with the โ€œonly if this condition is trueโ€ stuff. You may be misunderstanding the working of that.

Hi @Marc_Dillon

Thank you for such a detailed reply. I think I have it working as per your suggestion. For some reason I was under the impression I would use the Referenced Row Expression to return the rows I need and then for the โ€˜Set the values of some rowsโ€™ action I would use the โ€˜Only If this condition is Trueโ€™ function to dictate whether the functionality was triggered. I guess I misunderstood that piece in this instance.

Thank you again.

Top Labels in this Space