Reset on Edit based on view

Hi,

I am trying to reset on edit a column based on a view. The idea is if the view is “Extension” (the landing view the user sees) or the view is “form” (the view on which the edit should take place), the reset on edit should be triggered for said column. This is the formula used

OR(CONTEXT("View") = "Extension", CONTEXT("View") = "form")

However, not appears to happen. The column does reset if an edit action is initiated, but only when there isnt a formula.

What might I be doing wrong? How can I ensure this condition is met for reset on edit to take place?

Thanks.

1 Like

Columns with an initial value reset on edit only if the row is being edited in a form (either when adding a new record or modifying an existing one). However, if the user manually changes the value after it has been reset, this change will persist, as the column loses its “initial value” condition. To reset the value again, the form must be closed and reopened.

Regarding the use of CONTEXT("View"), it looks like you’re trying to trigger the reset while the user is in a form-type view. To achieve this, it’s better to modify the expression as follows:

OR(CONTEXT("View") = "Extension", CONTEXT("ViewType") = "Form")

Try this expression and see if it works correctly. Keep in mind that CONTEXT("View") = "form" will only work if the view is explicitly named “form”, which is uncommon. Therefore, it’s preferable to use CONTEXT("ViewType") = "Form" to ensure the condition applies to any form view.

1 Like

Awesome…thanks..been cracking my head over this all day. I change the edit destination to a form and it worked like magic. Thanks once again

1 Like

?

Thank you for this explanation. I had been trying unsuccessfully to reset on edit on a DETAIL view with the column in question being set as QUICK EDIT. Can’t make it work and I’m guessing there’s no work around?

(The quick edit is a YES/NO column which I’m using to show and hide REF_ROW inline tables within the detail view)

1 Like

Hello @leonsteber ,

Could you elaborate your requirement?

Is it correct assumption that the user will always navigate to the detail view from a summary view such as table or deck or card view?

Also are you looking for this functionality in a multi user app? If so , you may want to think hiw the column will behave if one user is already in a detail view and another is moving from summary to detail view on the same record? How should the column value behave for these two users?

1 Like

Hi @Suvrutt_Gurjar !

This is a single user app and yes, I think Detail view will always be accessed from Table/Deck views.

My Detail view has a bunch of inline tables generated from Related … (Ref_Rows). I had been following a suggestion from Grant Stead Why-certain-virtual-columns-slow-down-syncs (third reply) : “Like you can put a quick edit toggle on the detail view to show hide the REFROWs, which is also tied to the virtual columns… So it only calcs the lists on demand…

So I added a real column called Show Inline Table RefRows, Yes/No type and in the detail view it is selected as a QUICK EDIT column

All my Related … columns (the inline tables) have a SHOWIF of

AND(COUNT([Related ActivityGerminations]) > 0, [Show Inline Table RefRows])

So the toggle works fine, but I’d been hoping for a RESETIF solution to set it back to hide the lists by default. So whenever I go to a detail view, the inline tables are hidden, even if the last time I was on that row I’d left them unhidden.

(I’ve also been wondering… "So it only calcs the lists on demand…", should my Related … app expression also be:

IFS([Show Inline Table RefRows], REF_ROWS("ActivityGermination", "Seeds_ID"))

instead of just relying on SHOWIF? (In order to cut down VC calculations)

1 Like

Thank you for all the details. I believe you could have 2 scheduled hourly bots that are set apart 30 minutes to reset any records where the column is set to Yes.

I believe this is not a very recommended step as one should not disturb the system generated reverse reference columns.

Please take a look at the recommendation by @pravse who was CEO of AppSheet before AppSheet became part of Google.

The epic post on the sync performance is here

Solved: Improving performance by getting rid of unnecessar… - Google Cloud Community

1 Like