Using INPUT() to update another table using a value from this row

This “Tip” is a little report, with a sample app, on my own attempt to familiarize myself with the new INPUT() function. As @praveen has indicated, the advent of this function gives us the power of an “UPDATE EXISTING ROW(s) using values from this row” action:

Here’s a sample app I made to test this out:

https://www.appsheet.com/templates?appGuidString=502cc394-2717-4a69-8246-5fc26a1aa9cf

This extremely simple app has two tables: one with multiple records and one with only one record. The input function allowed me to make an action that takes a value (a word, in this case) from the record I happened to be viewing on the bigger table and then write it to the designated spot on the smaller table.

Here’s how I put it together.

  1. On the single record table I made the following action:

 

 

The expression is as follows:

3X_3_3_3350a8c114786d03d9f4c48112783b18d1591f84.png

In this case “Word_input” is just what I decided to call this function. You can make up just about any function name you want, I think. I set “AppSheet” as the default but in my application the default is just a placeholder because my app doesn’t use it; it always takes the value from the other table. So, I think the default value could be just about anything and it wouldn’t make an important difference in my app.

Before we go on, let’s take a look at how this action functions in isolation. In the app, I’ve set the action to display prominently with the label “WRITE WORD”:

 

 

I’ll hide this writing action when I actually use INPUT() in a working app of mine but I made it visible in the sample. If you tap on it inside the “Single word” menu, this happens:

 

 

Since the action hasn’t received a value for “Word_input”, it asks the user to provide it. The next step provides that value so the app doesn’t need to ask for it.

  1. On the big table, I made the following action:

 

 

Since “word_input” was part of the referenced action, I was able to select it and define it with a column name.

That’s it!! Works just fine!

3X_9_f_9fb5d0619fee11f035fe856f7725b9603fd0d128.gif

24 34 10.5K
34 REPLIES 34

Aurelien
Participant V

Great job, thanks for sharing this sample app !

Yes, good to see the new INPUT() function explained through an app. and your associated description/. Thank you @Kirk_Masden

@Kirk_Masden what a beautiful simple explanation. Way better than my complex wordy description. Thank you.

@Arthur_Rallu FYI

Thanks so much for your kind words, @praveen ! I think you have many different usages of this great new function in mind. I was only thinking about what I want to do in my own app, so I wasn’t burdened by the need to make a comprehensive explanation.

By the way, you helped me with a problem I have been struggling with regarding how to improve the performance of an app that has lots of inline actions that link to URLs. I’m using INPUT() to deal with that problem. This way, even if I have a huge number of words to look up on one table I can simply make the app rewrite the word that the user wants to look up onto a tiny sheet (just a few records). Then, since the sheet is tiny, it can have dozens of virtual columns without getting too heavy – at least that’s my idea. I hope I’m on the right track.

Lynn
Participant V

Thanks @Kirk_Masden
I might give this a test run . I have found lately that all the new “complex wordy descriptions” just make my head spin. Maybe Im getting too old for the new Appsheet.

Thanks for the encouragement, @Lynn ! I had trouble understanding things at first and that led me to try to put a sample app together before attempting to use the function in one of my main apps.

@Kirk_Masden
I find that is a good way to learn also.

Great example here @Kirk_Masden . I just used it to build the same functionality.

One thing to note is that the “With these inputs” section on the “execute an action on a set of rows” Action might not show up right away. I had to set up the ref’d Action, with the INPUT() first, and then save the editor before it showed up.

I don't think I would have ever figured this out if I hadn't seen your reply, thanks a ton! They need to make this more intuitive.

Is there any reason the default value would not show up? I have tried both a static value of 20 and a dynamic value of a column within the row.

Actually, I don’t understand how the default works. I hope someone else can explain that.

The 2nd argument for the input() expression is said to be “default value” when the form is launched for entry, but actualy it is broken now (I simply suspect just because of bug) while it did worked before at the time when this new function was introduced. So currently, 2nd argument is not doing any jobs.

@Lusha_Wang1 should have idea and thoughts for us.

As 2nd argument is NOT working, so we are able to omit the same for now. Also, we are oddly able to omit the first argument (which is directing the target column name) as we select the name of target column withing action config.

The most simplest working expression syntax is as above. Looks strange to me, but it does work.

Thanks! I think, though, that you would need the first part (something like the following) if you wanted to call it up in another action:

 input("my_function_name","")

Right?

on this document, the 1st argument is said to be

  • inputName ( Text 😞 Any input name that is unique within the context where it is used.

but actually we can omit, that what I said.

Wow! I suppose, though, that if we wanted to use the input function twice in one app (in two different ways), then we would need it. Thanks for the clarification.

All in all, currently 2 x argument for this expression is not really doing any jobs, but input() expression is believed to be expanded further, so this story turns to be false in the future.

but

input("", “”)
input(" ", " ")
input( . , . )

those expression are valid (accepted by Expression Assistant), works in the same way.

It looks like KAOMOJI -style expression we are talking internallly…

("", “”)
(" ", " ")
( . , . )

I will take a look. thanks.

Just some clarification:

There are currently 2 main uses for the INPUT() expression.

  1. Pop-up screen to allow manual user input to a column.
  2. Passing a variable from one record, through an “execute…” Action, to an Action on a different Record (possibly on another Table).

Kirk’s post here is more-so about the #2 usage.

In either use, you cannot “omit” either argument. A blank string is still a value being passed as an argument.

  • For use #1, the first argument is essentially not used for anything. The display in the pop-up comes from the column’s name/display-name/description.
  • For use #2, I definitely would recommend passing an actual descriptive value for the first argument, not a blank string.

The first argument is not a column name. You can think of it just as a variable name.

I also am experiencing that the default value does not seem to do anything currently.

That’s news to me

JPAlpano
Participant V

I just tried using Input for the action
Add a new row to another table using values from this row.
However, the input doesn’t pop up on button click and just proceeds adding the row using the default values of the Input().

Does this mean that input is not designed for this action?

HAVE YOU FOUND ANY ANSWER ABOUT IT? i have found the same problem

Not that I know of.  I have no choice but to use LINKTOFORM for now.
I haven't tested this again since, coz I received no feedback about it as well.

This link no longer works. Here’s a replacement link:

https://www.appsheet.com/samples/Inputfuction-230844?appGuidString=502cc394-2717-4a69-8246-5fc26a1aa...

Unfortunately, this platform doesn’t not allow posts to be edited after a certain amount of time so I can’t go back and fix it.

Here’s a link to a “tip” I wrote about how to make a direct link that works as the platform is currently configured:

Rehan_A_Khan
Participant II

Can I put the Whatsapp number at the time of INPUIT requires me the value to insert.
So that I can use that whatsapp no. live to send some text over there.
For example, I have application, in which there are many property details,
So i first goto detailed form, and when i click a behavior button named "Send Whatsapp to "
It asked me Input() whatsapp number, and I will insert the number, and it will send the whatsapp the required property details which is rightnow displays on the screen.
IS it possible.

I think you can add the number but I don’t know anything about linking to WhatsApp. Sorry.

Dears,

I got a similar problem from this post, if anyone could help me clarify the throubleshooting. Many thanks.

Thanks again @Kirk_Masden for your sample app. It helped me once again. I forgot how how it works, but your post is a nice documentation

Actually, sometimes I post stuff like this as notes for myself because I forget and need something to refer back too.

Oops!  I have to take this back.  I had updated the app to the new syntax and it was working properly on three apps of mine.  Then, all of the sudden it wasn't.  The new syntax may not be ready for prime time.
==========
I have updated the sample app to be in accord with the new syntax described here:
https://www.googlecloudcommunity.com/gc/Announcements/General-Availability-fort-the-INPUT-functional...

I am leaving the old syntax in the post.  This way, you can compare the old syntax shown here with the revised syntax in the app itself.

Saddam
Participant IV

Saddam_0-1702985264824.png

Dear @Kirk_Masden 

We don't see this option when we refer this action!!

Please help me on it.

Thanks for your feedback.  I am having the same problem.

Please see my comment here:
https://www.googlecloudcommunity.com/gc/Announcements/General-Availability-fort-the-INPUT-functional...

I wrote a follow-up "tip" to this tip:

Using INPUT() for "just in time" calculation and display
https://www.googlecloudcommunity.com/gc/Tips-Tricks/Using-INPUT-for-quot-just-in-time-quot-calculati...

I tried to explain how combining INPUT() with a tiny sheet on which to write the information to be displayed (an approach similar to this sample app) allows me to display information that requires calculation with SELECT() expressions without harming the user experience by slowing the app down.

As I've written above, I've posted a follow-up to this post about how one can use INPUT() to obtain two advantages:

  • Limit expensive calculations about the record being viewed to instances when the user requests the information
  • Limit sync time by only writing one "packet" of text data to a single cell on a tiny sheet (one or two lines), even though the data to be displayed may be fairly rich and diverse

https://www.googlecloudcommunity.com/gc/Tips-Tricks/Using-INPUT-for-quot-just-in-time-quot-calculati...

My post hasn't gotten any reactions and I wonder if that may be because what I wrote is so obvious to INPUT() users as not to be of interest.  Or, conversely, perhaps my idea throwing all of the data bound for display into a single cell didn't strike readers as being particularly advantageous.  Whatever your thoughts (negative or positive), I'd really appreciate feedback.  🙂  @Fabian_Weller @Aurelien @Suvrutt_Gurjar @Marc_Dillon @APiCC_Conor  @Koichi_Tsuji @RedVox @Daisy_Ramirez @イルカのえっちゃん 

Top Labels in this Space