Convert a virtual column into a real column--or the reverse

At least some of this is pretty basic and maybe self-evident to others, but I didn't realize it was possible until I happened upon the techniques recently. So, since I don't find these points explained in other posts, I'm documenting here for others who may be searching for this info sometime.

I have found that in the course of developing an app, it's not infrequent to decide to change a virtual column into a real column or vice versa. Here's how I implement those changes when I need to.

Convert virtual column to real column

This is really easy (at least with a spreadsheet data source--I haven't tested with a database source).

  1. In the data source, add the column using the same column name already in place for the virtual column.
  2. In AppSheet editor, regenerate the column structure for the table's columns.

That's it. AppSheet preserves the column's App formula and other properties. There's no impact to expressions, views, slices, etc., that reference the column.

Convert real column to virtual column

  1. Create a new virtual column that replicates the real column.
  2. Rename the real column to a new placeholder name--e.g., "ColumnName OLD"--in both AppSheet and the data source.
  3. Rename the virtual column to the real column's original name.
  4. Save.
  5. Delete the column from the data source.
  6. Regenerate the table's column structure in AppSheet.

Following step 4, I've found that most expressions, views, slices, etc., that originally referenced the real column now reliably reference the virtual column--especially if I performed steps 1-3 without saving along the way. I've also found that it's worth confirming at this point that the app still functions as expected since there are lots of nuances involved and opportunities for missteps--especially if you already did some other development trying out the virtual column after step 1 before committing to retaining it and moving on to the other steps. In that case, it's helpful to use a very unique column name in step 1 and then search for that name in the app definition available from Info > Properties > App Documentation.

14 1 1,556
1 REPLY 1

Wow this is so easy and I tested it. It really workd

Top Labels in this Space