I'm working on an old, large, undocumented, app that I've been asked to improve and evolve with some new functionalities. I'm treading carefully among the large number of slices and virtual columns, so in every part I'm touching I keep the existing formulas in place along with my new ones. This has been immensely beneficial.
Since there's no #, // or /* */ equivalent in AppSheet to keep some code in place without it being executed, I'm using this simple method to keep both codes in place.
I hope you find this useful. Happy AppSheeting!
IF( TRUE,
( My new code ),
( Old code )
)
In case I just want to remove the existing code without replacing it with a new one. This would depend on the field:
Like Valid If, Show?, etc. I use this:
OR( TRUE,
( Old code )
)
IFS( FALSE,
( Old code )
)
There is NO safe method to keep unused expressions in the App Formula field without replacing them with a new one. So while (1. Replacing Code) is OK, (2. Removing Code) is not.
Therefore, I copy the old expression and put it in the Initial Value field instead, with some indication that this code used to be in App Formula. Like this:
IFS( FALSE,
"*** The code below used to belong to App Formula ***" &
( Old code )
)
In case the Initial Value field already has some code, I use the first method, like this:
IF( TRUE,
( Working Initial Value expression ),
"*** The code below used to belong to App Formula ***" &
( Old code )
)
Update - Here's a real-life example:
These are useful suggestions Joseph, in the absence of commenting the code that is not yet possible with AppSheet. Thank you.
Thanks my friend!
Here's a freshly-produced real-life example: