I'm developing a sample taking application an...

references
(Sebastian Tiller) #1

I’m developing a sample taking application and I’m trying to get my head around App Formulas and Spreadsheet Formulas and which is best for my situation.

https://help.appsheet.com/data/columns/app-formulas-and-initial-values

I have a Thing and I’m taking Samples on the thing. The Thing might have multiple Samples.

I have a column in my Thing database structure called date_last_inspected which I’m currently using the following App Formula to populate:

MAX([Samples][date_created])

This works after I take multiple samples and then resave the Thing record. As I would suspect given the definition in the documentation.

If I create a Virtual Column it is automatically updated as I would suspect. However, as far as I understand it this is only kept at the App Sheet layer and is not saved back into the database.

I need to be able to save the maximum returned date back into the database so that an external system can reference it. Is this possible?

Any help would be greatly appreciated.

(Sebastian Tiller) #2

@Mary_Jane_Pender Awesome thanks, I will give that a go!

(Sebastian Tiller) #3

I tried what MJ suggested and while the Virtual Column does display the correct value it still doesn’t make it into the database until I’ve opened and saved that particular entry.

(Mary Jane Pender) #4

When you create a new record the virtual column gets updated immediately, then the physical column that you added to hold the value in the virtual column should be updated - make sure that you click into the field of the new physical column before you save.

You should see it updated with the value in the virtual column.@Mary_Jane_Pender

(Mary Jane Pender) #5

Hi Sebastian,

You need a new physical column to hold the value from the virtual column.

So put the following into your new physical column (Max Return Date) in the App Formula section of the Max Return Date column to make it update from the virtual column:

App Formula

=[max date virtual column].

Hope this helps.

m.j.