I think Iโve found a way to identify whether the user is just viewing an existing row, editing an existing one, or adding a new one:
First, add a (physical, not virtual) column to track the number of times the row has been edited. I do this by adding
column, [ecount] (โedit countโ), of type Number, with an App formula of =([_this] + 1).
Then, add a virtual column to indicate whether the row is being viewed, added, or edited. I call mine [vtype] (โview typeโ). Use the App formula:
=if(([ecount] = lookup([_thisrow].[id], MyTable, id, ecount)), โviewโ, if(([ecount] = 1), โaddโ, โeditโ))
Replace MyTable with the name of the table, and id with the name of the key column.
You can then query [vtype] to determine how the row is being accessed: add, edit, or view.
The way this works is that lookup() goes into the actual table to retrieve values and bypasses the copy of a row being edited. If the the row is only being viewed (as in a Detail view, or anywhere outside a Form view), the row isnโt copied, so [ecount] and lookup(โฆ, ecount) refer to the same thing, making them equal. If the row is being used in a Form view, column references refer to a copy of the row that contains the new values from the form. The form copyโs [ecount] column will have been updated by its App formula, so the copyโs wonโt equal the originalโs still in the table. A new row will always have an [ecount] value of 1; any other value means it was a preexisting row.
Thoughts?
Having the [ecount] column will also provide you with some insight into how active each row is.
@Steven_Coile dude, I havenโt even thought of doing thisโฆ Very smart! It would be cool if appsheet had this built in somehowโฆ @praveen @MultiTech_Visions
However, short term this just opened up some design options for me!
@Steven_Coile very nice!
Very nice indeed.
Have you given thought to how to keep track of whoโs editing and when?
A paper trail?
Is that important?
If it is, you could try this:
Create an action thatโs watching the [vtype] column, and when itโs switched to edit and you save it concatenates the datetime/user to the paper-trail.
concatenate([PaperTrail], "| ", NOW(), โ(โ, USEREMAIL(), โ)โ)
or some such formula like that.
the important part is the concatenation of the original column with new stuff.
It simply adds on.
Now youโve got a paper trail.
@MultiTech_Visions wellโฆ Crazy talkโฆ How do you think I can bend this for financial period based task progressing?
@Grant_Stead not sure about your exact specifications, but one thing Iโve found with AppSheet is that itโs incredibly powerful with the logic you can apply to your data.
For processing certain events at a certain period, sounds like you need a status column, or maybe a phase column, to track the progress of the row through the whatever process itโs going through.
@MultiTech_Visions yeah, itโs more like a percent completeโฆ So Iโve got lots of tasks, and one of them is a task to install a deck, and itโs worth $10,000.00 โฆ
Period 1 - 0% - $0.00 Period 2 - 0% - $0.00 Period 3 - 10% - $1,000.00 Period 4 - 40% - $3,000.00 Period 5 - 90% - $5,000.00 Period 6 - 0% - $0.00 Period 7 - 10% - $1,000.00
So, right now Iโm doing these updates in a secondary tableโฆ, And itโs not very smoothโฆ
@Grant_Stead so what are you looking to do here?
Well, the foreman are updating activities as they go every dayโฆ Then the mangers lock the financial period and invoice off the progressโฆ So I need to be able to show what process was earned in each periodโฆ But it has to be easy to progress the stepsโฆ
User | Count |
---|---|
41 | |
25 | |
25 | |
17 | |
12 |