Best way to autoupdate column

Hello,
i have a table with some column iโ€™d like to autoupdate like โ€œstatusโ€ โ€œlocationโ€ based on a changing in another table.
iโ€™ve deleted the columns and create new ones as virtual column to achive the autoupdate on every sync.
Everything is fine except this system is not flexible at all. Could be some exceptions where i want to update that field with an action or a workflow to force a different value.
Any suggestion to find a way to achive a more flexible autoupdate?

0 11 1,964
11 REPLIES 11

Steve
Platinum 4
Platinum 4

Virtual columns will not work at all if you want to use actions or workflows.

Weโ€™ll need more details of what youโ€™re trying to do to offer concrete suggestions.

Is not a specific thing, there are some different scenarios;
one of them for example:
i had an Enum column [Location] (parking lot, zone A, zone B)
Now i have another table โ€œOrderโ€ that give me this information so i have switched the Enum column [Location], with a virtual column [Location] (lookup(maxrow(Orderโ€ฆ)) so everything is automated and no one need to update the location that is great.
I also have a workflow with a condition [_THISROW_BEFORE].[Location] <> [_THISROW_AFTER].[Location] that seems doesnโ€™t work anymore;
is because the virtual column change doesnโ€™t trigger this formula?
If it is, iโ€™m trying to figure out other possbile to way to manage such automations without loose features in the app.

Correct. Workflows are only triggered by changes to normalโ€“not virtualโ€“rows.

A big downside of virtual columns is the time it takes to calculate them. Theyโ€™re recalculated each time the app syncs, and the time it takes grows as your data does. Expressions that look through tables, such as SELECT(), LOOKUP(), and MAXROW(), consume a lot of time very quickly, and are best avoided whenever practical.

Based on what youโ€™ve shared, I suspect you would benefit by replacing the virtual column with a normal column and use an action to update the columnโ€™s value. The action could be attached to the Order form to update the location when the form is saved, or you could use a workflow to trigger the action when the updated form is synced.

So i need to go way more deep with actions and workflows;
the actual pattern is like, action/workflow that change something and then a cascade of virtual column to update a lot of field in various table that is such a great automation but at the same time iโ€™m loosing other features. More work for me; nothing impossible, just way more tricky to adapt everything.

Thanks

For the specific case.
Order table
I have an action โ€œCLOSEโ€ (set valueโ€ฆ) [Status]=CLOSE
then i have [Location]=if([Status]=CLOSE,โ€œparking lotโ€,โ€œzone Bโ€)

table TRUCK
vc [LOCATION]=lookup(max rowโ€ฆ) that just pick the more recent location from the table Order based on a Truckโ€™s plate.
How can i send this information from the Order table and automatically update the row on Truck without edit the row?

For the Truck table, you need an action to set the current location:

  • For records of this table: Truck
  • Do this: Data: set the value of some columns in this row
  • Set these columns:
    • Location: (you current LOOKUP() expression)

For the Order table, you need an action to tell the truck to update itself when the order Status has changed to CLOSE:

  • For records of this table: Order
  • Do this: Data: execute an action on a set of rows
  • Referenced table: Truck
  • Referenced rows: LIST([truck-ref]) (replace truck-ref with the name of the column in the Order table that contains a Ref to the truck)
  • Referenced action: (the action above that updates location)
  • Only if this condition is true:
     AND(
        ("CLOSE" <> LOOKUP([_THISROW], "Order", "row-key", "Status")),
        ("CLOSE" = [Status])
      ) 
    replacing row-key with the name of the key column of the Order table.

Then, in the Order form view, attach the second action above as the Form Saved event action:

Thanks,
i would try this method that i didnโ€™t know;
the second part is not accurate about my situation;

in the Order table i would always pick the โ€œcurrentโ€ [Location] because it changes during the day, not only when the status switch to Close.

Iโ€™ve done exactly what you told me,
except for the

in the second action, because as i said before, iโ€™m not sure this is my scenario. I just left โ€œtrueโ€ as condition and tried activating manually both the actions.
Result:

  • From table Truck, action (lookup(maxrowโ€ฆ) works perfectly, it updates my column extracting the exact value from Order table and trigger the workflow based on change value before/after;
  • From table Order, action โ€œto tell the truck to update itselfโ€, seems ok too BUT in this case the change doesnโ€™t triggers other workflow like the VC issue.
    At this point i have 2 issues,
  • i need these 2 actions automatic during the various Orders steps
  • the change caused by second action has to be valid for the [_THISROW_BEFORE].[Location] <> [_THISROW_AFTER].[Location]
    that trigger others worflows as well.

Thank you very much for help, iโ€™m not far from the final goal with this App; i just need a couple automations more to be really worthy.

There are two ways to achieve this:

  1. Attach the Orders action from above to the โ€œvarious Orders stepsโ€. If the steps are done from a form view, attach the action to the form as I described above. If the steps are done as actions, add this action to those actions, perhaps as part of a grouped action.

  2. Create a workflow for all updates (not adds or deletes) on the Orders table that performs the Orders action above.

I donโ€™t understand what you mean by this.

Ok @Steve ,
Part 1
the various Orders step, some are triggered by action in detail view, other are workflow with โ€œchange dataโ€ triggered by an enum choice inside the formโ€ฆ
so now i have:

  • in table Truck a new action called โ€œlookup locationโ€ (lookup(maxโ€ฆ)
  • in table Order a new action called โ€œtrigger lookup locationโ€

Do i have to attach โ€œtrigger lookup locationโ€ in every scenario i suppose to want to trigger it? Am i right?

Part 2.
Table Truck
I have a workflow โ€œrecord historyโ€ where if a certain number of columns change, it does โ€œchange dataโ€; the trigger condition is
OR(
[_THISROW_BEFORE].[Location] <> [_THISROW_AFTER].[Location],
.
.
.
)
So if at least one column change i want to trigger this action.
Everthing was fine but this is why i started this thread; because 2 of these column were VC (one was Location) and this workflow didnโ€™t works.
Now apparently this workflow doesnโ€™t work also with this โ€œtrigger lookup locationโ€ action; the change of value seems doesnโ€™t trigger it like the VC did.
But with some other test seems that this workflow doesnโ€™t work as expected; i donโ€™t know why at this point; is just an ORโ€ฆ

At this point iโ€™d like to fix the first part with the auto update, then we will check th second part.

Yep.

Top Labels in this Space