Using INPUT() for "just in time" calculation and display

This post is a follow-up to "Using INPUT() to update another table using a value from this row":
https://www.googlecloudcommunity.com/gc/Tips-Tricks/Using-INPUT-to-update-another-table-using-a-valu...

In that tip, I provide a sample app that shows, as the title indicates how to take a value from a row and update a cell on another table.  What I did not do was try to explain why that can be very useful.  In this post I'll attempt to do that.

Here are some screenshots from an app I'm working on:

Screenshot 2024-02-03 at 12.11.32.png

โ€ƒ

Screenshot 2024-02-03 at 12.12.35.png

The first image is the bottom part of a "card" in my flashcard app.  The marked action is a grouped action.  The first action writes a long string via "With these inputs" for access on the other table via the input action.

The following illustration shows what I am doing:
Screenshot 2024-02-03 at 14.19.41.pngโ€ƒ
The QuickChart calculations and the calculations of dates required the use of SELECT() expressions because anticipated dates depend on a count of other records that are ahead of the current one and on the calculation of a couple of types of rates of progress.  But those details aren't important here. The key point is that INPUT() function allows us to access the results of complex SELECT() and other expressions without weighing our apps down.  It's akin to "just in time" manufacturing; instead of constantly calculating and recalculating information so that it will be available if the user wants it, it is only calculated when it is required.  Moreover, even if many virtual columns are used in the second table for additional calculations and display, these won't cause problems because the table is tiny.

Finally, in regard to how you prepare your data to be split and displayed in the targeted view, I recommend using two strings, one for the splitting and and one to insure that your INDEX() numbers won't change, even if you have an empty value.    Let's say that the string used for the splitting will be "A1B2C3" and that the second string will be "X1Y2Z3".  When you concatenate your string it'll look something like this:

CONCATENATE([first value],"X1Y2Z3A1B2C3",[second value],"X1Y2Z3A1B2C3",[third value],"X1Y2Z3A1B2C3",  . . . etc.

Let's say that the [second value] is an empty string in this case.  After you SPLIT() with "A1B2C3", you can use INDEX to correctly locate the second spot.  Then after you use SUBSTITUTE() to remove the "X1Y2Z3" string, you will be left with an empty string right in the second spot where it is supposed to be.  Without the "X1Y2Z3", the INDEX() numbers following an empty spot would all be off.

Based on my own experience, I have to admit that using INPUT() in this way can be somewhat difficult because everything must be carefully packed and then unpacked, then prepared for display.  But, in terms of app performance, I've found it to be more than worth the effort. 

6 9 413
9 REPLIES 9

@Kirk_Masden 

Thank you for sharing useful information and wisdom.

I have tried to understand the above text by translating it from English to Japanese using the translation tool (DeepL), but to be honest, I don't think I understand 100% of it. (Apologies for my lack of English language skills...)

However, I agree with you that depending on how you use the INPUT function, it can be very effective in terms of performance, as it avoids having complex virtual columns in the table all the time.

Thank you very much for sharing your wisdom!
Your tips and tricks are always a pleasure to read.

Translated with www.DeepL.com/Translator (free version)

 

ใ€ๆ—ฅๆœฌ่ชžใ€‘

ๆœ‰็›Šใชๆƒ…ๅ ฑใจ็Ÿฅๆตใฎๅ…ฑๆœ‰ใ‚ใ‚ŠใŒใจใ†ใ”ใ–ใ„ใพใ™ใ€‚

ไธŠ่จ˜ใฎๆ–‡็ซ ใ‚’็ฟป่จณใƒ„ใƒผใƒซ๏ผˆDeepL๏ผ‰ใงใ€่‹ฑ่ชžใ‹ใ‚‰ๆ—ฅๆœฌ่ชžใซ็ฟป่จณใ—ใฆ็†่งฃใ—ใ‚ˆใ†ใจใ—ใพใ—ใŸใŒใ€ๆญฃ็›ดใชใจใ“ใ‚ใ‚’่จ€ใ†ใจใ€100๏ผ…ใฎ็†่งฃใฏใงใใฆใ„ใชใ„ใจๆ€ใ„ใพใ™ใ€‚๏ผˆ่‹ฑ่ชžๅŠ›ใŒ็„กใใฆ็”ณใ—่จณใ‚ใ‚Šใพใ›ใ‚“โ€ฆ๏ผ‰

ใ—ใ‹ใ—ใ€ใ‚ใชใŸใŒใŠใฃใ—ใ‚ƒใ‚‹ใ‚ˆใ†ใซใ€INPUT้–ขๆ•ฐใฎไฝฟ็”จๆ–นๆณ•ใซใ‚ˆใฃใฆใฏใ€่ค‡้›‘ใชใƒใƒผใƒใƒฃใƒซใ‚ซใƒฉใƒ ใ‚’ๅธธใซใƒ†ใƒผใƒ–ใƒซใซ็ฝฎใ„ใฆใŠใใฎใ‚’ๅ›ž้ฟใงใใ‚‹ใŸใ‚ใ€ใƒ‘ใƒ•ใ‚ฉใƒผใƒžใƒณใ‚นใฎ้ขใง้žๅธธใซๅŠนๆžœใ‚’็™บๆฎใ™ใ‚‹ใจใ„ใ†ไบ‹ใซๅŒๆ„่‡ดใ—ใพใ™ใ€‚

็Ÿฅๆตใฎๅ…ฑๆœ‰ใ€่ช ใซใ‚ใ‚ŠใŒใจใ†ใ”ใ–ใ„ใพใ™๏ผ
ใ‚ใชใŸใฎใƒ’ใƒณใƒˆใจใ‚ณใƒ„ใฏใ€ๆฏŽๅ›žๆ‹่ชญใ•ใ›ใฆ้ ‚ใ„ใฆใŠใ‚Šใพใ™ใ€‚

 

Thank you very much!  I'll write a little in English and then say "hello" in Japanese.

@Marc_Dillon 's comment below shows that the problem is in my writing and not one that a good translator can fix.  I hope, though, that our discussion here will clarify what I was trying to say.

้›ฃ่งฃใชๆŠ•็จฟใซๆ™‚้–“ใ‚’ๅ‰ฒใ„ใฆใใ ใ•ใ‚Šใ€ใ‚ใ‚ŠใŒใจใ†ใ”ใ–ใ„ใพใ™ใ€‚็งใฏใ‚ขใƒกใƒชใ‚ซไบบใง็†Šๆœฌใง็”Ÿๆดปใ—ใฆใ„ใพใ™ใ€‚ๆ—ฅๆœฌไบบใจๆ€ใ‚ใ‚Œใ‚‹ๆ–นใฎๅๅ‰ใŒใ“ใ†ใ—ใŸใ‚ณใƒŸใƒฅใƒ‹ใƒ†ใ‚ฃใง่ฆ‹ใ‹ใ‘ใชใ„ๆ™‚ไปฃใ‹ใ‚‰ๅ‚ๅŠ ใ—ใฆใ„ใพใ™ใฎใงใ€่ฟ‘ๅนดๆ—ฅๆœฌใงAppSheetใŒๅฎš็€ใ—ใฆใใฆใ„ใ‚‹ใ“ใจใ‚’ๅคงๅค‰ๅฌ‰ใ—ใๆ€ใ„ใพใ™ใ€‚

ใ•ใฆใ€่จ€ใ„ใŸใ‹ใฃใŸใ“ใจใซใคใ„ใฆใฏใ€Marcใ•ใ‚“ใŒๆ›ธใ„ใฆใใ‚ŒใŸใ‚ˆใ†ใซใ€INPUT()ใŒใชใ‘ใ‚Œใฐใ€ๆ™ฎๆฎตใ‹ใ‚‰่จˆ็ฎ—ๅŠ›ใ‚’่ฆใ™ใ‚‹ virtual colulms ใ‚’ไฝฟใ†ใ“ใจใซใชใ‚Šใพใ™ใŒใ€INPUT()ใฎใŠ้™ฐใงๅฟ…่ฆใช่จˆ็ฎ—ใ‚’ๅฟ…่ฆใชใจใใซใ ใ‘ใ‚„ใฃใฆใ‚‚ใ‚‰ใˆใพใ™ใ€‚่ชฌๆ˜Žใ—ใ‚ˆใ†ใจใ—ใฆใ„ใŸใ‚‚ใ†ไธ€ใคใฎๅทฅๅคซใ€ใคใพใ‚Š่ค‡ๆ•ฐใฎ่จˆ็ฎ—็ตๆžœใ‚’ไธ€ใคใฎ้•ทใ„ๆ–‡ๅญ—ๅˆ—ใซใ—ใฆใ€INPUT()ใ‚’้€šใ—ใฆ่กจ็คบ็”จใซๅˆฅใฎใƒ†ใƒผใƒ–ใƒซใซ้€ใ‚‹ใ“ใจใงใ™ใ€‚ใ—ใ‹ใ—ใ€ใใ‚‚ใใ‚‚ใใฎๅฟ…่ฆๆ€งใฏๆ˜Ž็ขบใงใชใ„ใ“ใจใ‚’Marcใ•ใ‚“ใซๆŒ‡ๆ‘˜ใ•ใ‚Œใฆใ„ใพใ™ใ€‚ใใฎ็‚นใซใคใ„ใฆใฏใ€ใ“ใ‚Œใ‹ใ‚‰ๆ›ธใMarcใ•ใ‚“ใธใฎ็ญ”ใˆใฏๅฐ‘ใ—ๅ‚่€ƒใซใชใ‚‹ใ‹ใ‚‚ใ—ใ‚Œใพใ›ใ‚“ใ€‚

I 100% agree that INPUT() is an amazing addition to Appsheet, and that calculating expensive formulas on-demand is a great way to reduce performance issues on an app. With that said, I can't say that I understand what you're trying to show here, nor why you're concatenating multiple values into a single cell.

Thanks Marc!  Your response and the response from @ใ‚คใƒซใ‚ซใฎใˆใฃใกใ‚ƒใ‚“ have made it clear to me that the initial lack of response was due to my failure to explain myself properly.

Since we are in agreement about avoiding the placement of expensive expressions in virtual columns, I'll skip that point.

And, I'd like to emphasize that the usage I'm trying to explain here is the same as that of the sample app I made a couple of years ago ( https://www.googlecloudcommunity.com/gc/Tips-Tricks/Using-INPUT-to-update-another-table-using-a-valu...) in that any one of a long list of records on one table can send something to be displayed on the tiny table.

So, as you rightly point out, the new part is the idea that we can use a single input expression to send all of the information that is needed to build a complete view.

Assumption (which may not be correct): It's a good idea to avoid large numbers of "to-be-synced" data in the upper right corner of user's apps:
Screenshot 2024-02-07 at 14.59.19.png

Even a very large complicated string still only results in one little sync added to the line and this usually resolves quickly.  It might be almost as quick to use multiple inputs to send the data individually but I haven't tested it.

But, I can say that I am not alone in doing something like this.  Here's an old post of mine I titled "Put multiple values in single cells to reduce writing time":

https://www.googlecloudcommunity.com/gc/Tips-Tricks/Put-multiple-values-in-single-cells-to-reduce-wr...

My first response was from @Aleksi, who wrote "Iโ€™m always using this kind of approach with app variables."  I was very happy to read this because it told me that, if Aleksi was doing it, it was a reasonable approach.  There's some interesting (at least I was very interested) discussion in regard to this post, including from Praveen (that great leader we all miss).

Another possible advantage of my approach of throwing everything in one cell: When one imagines additional types of data for display or to be used for other purposes in the target view, one does not need to add a new column to the target table.  The single cell takes whatever you want to throw at it -- few, many, small, large -- as the case may be.  It's true that virtual columns need to be added but if the table is tiny they don't hurt performance and are easy to add and remove.


I see!
So the fact that multiple columns were concatenated had a performance-enhancing effect in itself?

I did not have this idea.
I'll try it next time!

Yes, exactly!  At least, I think it had a performance-enhancing effect.  I never went to the effort to try to build the same functionality in two ways and see which one performed better.  But I suspect that another method would not perform as well;  I'm quite happy with how my method performs.  ๐Ÿ™‚

any one of a long list of records on one table can send something to be displayed on the tiny table.


I think what's missing is the reason why you are sending a record from a table to a "tiny table"?

 

Assumption (which may not be correct): It's a good idea to avoid large numbers of "to-be-synced" data in the upper right corner of user's apps:

Even a very large complicated string still only results in one little sync added to the line and this usually resolves quickly.  It might be almost as quick to use multiple inputs to send the data individually but I haven't tested it.


Definitely it's good to reduce the total number of syncs. But you can edit any number of columns in a single record at once, and it's still only a single sync.

 

I can see your point about a single combined column being scalable instead of having to add new real columns.

Thanks!  This feedback is very helpful to me.  I'm particularly glad to learn that "you can edit any number of columns in a single record at once, and it's still only a single sync."  I didn't know that.  I wanted to share how I'm using INPUT() but I think what I'm really interested in is learning how others are using it.  I imagine it's getting put to work in a variety of ways that I can't yet imagine.

Sorry.  Just realized that I didn't answer this properly:

I think what's missing is the reason why you are sending a record from a table to a "tiny table"?

The reason is that I wind up using a fair number of virtual columns to parse the information sent and to prepare it for display. If the virtual columns where to be located on large table they would be more "expensive" than if they are on a table with only one or two rows. Similarly, sending the information to a small table means that I don't need to make another real column on my main table(s) to accept that results of the actions. So, sending stuff to a tiny table is all about efficiency and performance.

Top Labels in this Space