Migrating off of virtual columns

I am systematically migrating virtual columns into real columns (on a psql DB). Is there a quick and easy way for me to retrospectively set all the initial values on this new column after adding it, regenerating the table structure and setting the app formula as well as the initial value expression?

Works fine if you open the record and just save it again but I can do this for thousands of records. I tried playing with automations and actions but can't seem to trigger the EDIT event on all records.

Another option is to trigger an EDIT action via the API but that's also more work

0 4 100
4 REPLIES 4

The easiest way is to run an Update query in the database.

Not if there are complicated app formulas on the field....

You still could...you would just replicate the expression in the Update query.

I just realized you had said this:


@silentfred wrote:

and setting the app formula as well as the initial value expression?


Just a quick note, if an App Formula is present, any Initial Value expression is ignored.

HOWEVER, you can take advantage of the App Formula to update your rows by simply running them through a Bot and making a simple edit on each row - similar to what you did by opening the row and just Saving it.  I frequently include an "Edit Count" column and when I want to just trigger an update so the App formulas execute, i will bump the count by 1. 

But you can do this in some other way.  Maybe you have a DateTime column.  If not an issue for your data, just add 1 minute to the Time on each row.  Some simple un-intrusive edit will do it.  this does mean adding a Bot and an action to do these but it would be quicker than manually editing the rows.

 

I tried exactly that - but could not find the appropriate action to link to a bot

Top Labels in this Space