I think I've found a way to identify whether ...

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?

1 8 375
  • UX
8 REPLIES 8

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.

@Grant_Stead

@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โ€ฆ

Top Labels in this Space