New INPUT() function --- binding dynamic inputs to a data change action

SUMMARY:
We now have an INPUT(, ) function that can be used to define inputs that are dynamically โ€œboundโ€ to values via user input or via other actions that compose them.

This is a beta feature but available for anyone to try. If you run into issues please let us know. As always, we would love your feedback and suggestions.

This addresses two popular feature requests:

This only works today for limited scenarios involving the SetColumnValue action being invoked from a Ref Action. Thereโ€™s more coming that extends this mechanism to Add Row actions and to automation tasks.

DETAIL:
Much of the basic AppSheet app interface uses โ€œCRUDโ€ operations โ€” in particular, add/update operations on row data driven by the column structure of the tables. We automatically generate interfaces (UI or data change actions) for these CRUD operations based on the schema. Using these interfaces, end-users or application logic can โ€œinvokeโ€ CRUD operations and pass in the appropriate โ€œinputsโ€ to configure them.

However, more advanced AppSheet interfaces use Actions (in UI and automation) and Tasks and Processes (in automation). Actions, Tasks, and Processes are logical operations rather than physical operations. We currently use expressions to configure the behavior of these logical operations. But so far, we had no mechanisms to pass dynamic โ€œinputsโ€ into them. It is important to do so as AppSheet apps have a compositional model โ€” individual elements can be composed into more complex elements. In the case of actions, individual actions can be composed into complex actions. Inputs for actions are a mechanism to โ€œparametrizeโ€ the logic so that the same action can behave differently depending on how it is composed.

See Dynamic inputs for data change actions | AppSheet Help Center for detailed description

40 117 14.2K
117 REPLIES 117

Check the column(s) presented in the Input dialog and make sure there are no rules that would prevent editing the values. The columns Valid_If, Edit_If, and I suspect Show_If expressions still apply. Think of the dialog as a normal Form editing a complete row that only allows editing of the designated columns from the INPUT() functions.

So I did some additional testing by just changing the field in the standard edit form one by one rather than bulk editing and using the action linked with the input function.

The process executed without any issues, so from that I would gather the problem lies with the Input function rather than a field limitation. I suppose it could have something to do with those fields that have initial value resets assigned to them, however even when using the input function those fields already update according to the reset.

@WillowMobileSystems I figured out what is causing my issue and why it works in the edit form and not with the input function. Silly mistake.

I have one field โ€˜Created_Byโ€™ marked as email type. In those instances where the edit form works I donโ€™t include that field in the edit form, but the email validation is checked with the input function. Well, as it turns out I have a lot of โ€˜Created_Byโ€™ entries that are just a plain text entry of โ€œOnlineโ€.

Thanks for the heads up, it made me check and re-check things.

I think part of my concern with the particular issue I am experiencing is that the input dialog overlays the top right corner where the โ€˜syncโ€™ button is hidden behind it. Therefore, it is hard for me to tell if the changes are pending, as it would be indicated with the counter, and maybe the dialog just stays open until those changes persisted. Could be a stretch in my thinking, but maybe possible?

Steve
Platinum 4
Platinum 4

Hello friends, iโ€™m trying to use the input() function in a very simple way, but i canโ€™t get the popup to save, this is my current configuration, iโ€™m hoping to use input() as a way to add comments to rows directly from a dynamic dashboard by using an inline action.

INPUT("Comentario",TEXT(""))

I noticed few actions like LINKTOVIEW not working in dashboard views. @Rafael_ANEIC-PY

I think the โ€œnot able to saveโ€ issue is indicative that there is some other invalid data in the record.

See this GIF. I try the INPUT() first, save doesnโ€™t work. Then I open the edit form, a different column is invalid, so I change that to a valid value, then save, then try INPUT() again and it works.

3X_e_3_e32d288a4a1f23360f9c35a3bf6c2f86845b80d6.gif

That may be it, but i gotta ask, how does INPUT() work exactly? is it re saving the entire row again? how can i use it to edit a single column in a row without messing with the other data?

I suspect it might be trying to save the entire row again, but saving only one column of data it wonโ€™t be possible.

Yes, I believe this is how every single data change in Appsheet works.

Oh, thatโ€™s a rookie mistake on my part then, iโ€™m trying to use INPUT() to save a coment to a row thatโ€™s already been saved before, is that possible to achieve using INPUT()?

Of course. Just like how youโ€™re doing. But all the rest of the values in the record need to pass validation.

Yeah, but i want to change that one column without changing the rest, i have removed all โ€œrequiredโ€ checks, and tried to reassign all other columns to their same values:

But it still doesnโ€™t allow me to save, any ideas?

Hereโ€™s my config for the โ€œEstadoโ€ column:

Estado

And for the โ€œComentario_2โ€ column:

Comentario_2

I understand that. Iโ€™m saying that Appsheet saves entire records as a whole โ€œblockโ€, even if you just change one value.


3X_2_1_21e24111a6e532bddda34a9dfa3a26e745e890d6.png
I assume this is intended to keep the previous value? That would only be necessary if this column had resetOnEdit turned on.


Keep in mind my first message started with โ€œI thinkโ€. There might be other reasons why the INPUT() pop-up isnโ€™t saving besides the validation that Iโ€™m talking about.

Try to open the record in a basic edit form like I did, and re-save, does it let you or does it say some value is invalid? What sort of valid_if expressions do you have on the other columns in the record, not the ones that youโ€™re editing.

Bingo, i had some bad dummy data that messed up a dereference, and that didnโ€™t let me save the row, it works now, thanks a lot @Marc_Dillon ! sorry for repeating myself at first.

I had the INPUT() can't save issue & your comment actually was the solution.

 

I had added a new field to my table that was a required field. On older entries, that required field was/is blank. So when I would go to do a bulk Input() action the SAVE wouldn't fire because the older forms didn't have the field filled out.

 

There were 2 options to get around this on older entries.

Option 1, go to the data table and fill in the entries on mass (easy because it's just an enum with 3 options).

Or

Option 2, have the required field requirement only be a requirement at the time it is filled out with this formula [Date]=NOW()

Option 3,

Required if with context()

CONTEXT("VIEW")<>"TheViewWhereYouWantInput()"

CONTEXT() | AppSheet Help Center

I also had this problem and this was the solution as well.

Sure! Good luck!

On iOS (Android untested) , when using the INPUT() function on a โ€˜set the values of some columns in this rowโ€™ action to create a popup dialog, the upload button for file and image columns do nothing when clicked.

3X_c_f_cfcc11c6697386749a66accbd979fae866aae785.png

On desktop browser, the buttons open up upload dialogs as expected.

Already submitted a support ticket, just wanted to let others know so it doesnโ€™t blind-side them like it did me.

I am having this exact same problem since one week ago.

Feature request

Save button in INPUT() function is not working right now.

Could you report the details via the link below?
https://www.appsheet.com/Support/Contact

Thank you.  I just reported.  If only the save button worked, this would be a massive feature upgrade for us!!!

Solution:

Some required fields were being left blank. Solved using required if CONTEXT("VIEWTYPE")=FORM in the fields I didn't need in my INPUT()

Hi team ! 

We have a display issue when using INPUT() if the form is using "Show" type fields.

jeremy_tran1_0-1647618239368.png

Ideally we would need to have only Comment input + Save button...  

Any idea ? 

Cheers !

I've just been using this function in a bot to update some rows in another table and it works very well!

I was just wondering what the current status of the function is?  It's been a bit quiet since December 2021 and that warning message about it being in beta is a little worrying as I'm using it in production apps...

Have the extras you wanted to add been implemented or is it one of those side projects that has fallen to the side for more important work?

The latter, including new charts, rich text, or basically all of the preview features

I recommend avoiding preview features entirely.

Has anyone found a way to specify the initial value in an INPUT() function?
I'm talking about the little INPUT form view.

I tried Reset on Edit enabled with an initial value set to 1.
I also tried INPUT("Enum", 1) or INPUT("Enum", "") or INPUT("Enum",TEXT("")) in the INPUT Action.
But the INPUT form view always opens up with the actual value (in this case 3).

Fabian_Weller_0-1660405144895.png

Fabian_Weller_1-1660405491921.png

Adding @Suvrutt_Gurjar and @khuslid 

Hi @Fabian_Weller ,

Yes, the iNPUT() function does not seem to allow an initial value.

How about using a LINKTOROW() action instead of INPUT() action.

You could create form view with just "Enum" and "key " field in it on the same table and then LINKTOROW([Key], " Form View With only Enum & Key Field") action could possibly achieve a similar effect. The [Enum] could be set to have a reset on edit with the desired initial value.

Thank you @Suvrutt_Gurjar that would be a nice solution. In Reset on edit? I could say
CONTEXT("View")="Form View With only Enum & Key Field"
And give it an initial value in only that view.

But I like the way INPUT() works. Because the user stays on the same view.
Thank you for confirming that INPUT() does not allow initial values.

Did you tried with INPUT("Enum",[Enum])  and giving initial value to column [Enum]?? 

@Kabuliรฑo Thank you for that. I tried it and it does not work. Same behavior. It just takes the actual  value.

In case it's helpful: one detail I originally overlooked in using INPUT() is that the first argument should not be a name that might conflict with a column name.


Syntax

INPUT(inputName, defaultValueExpression)

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

  • defaultValueExpression - Default value (any type) that should be associated with this expression.


 

@dbaum That's a very valid input. Thank you.
But even when I name it different, I can't get it to reset and/or have an initial value.

Bug: Reset on Edit is not working properly - Google Cloud Community

@Steve wrote:

Reset on edit? is considered only when the form is first opened. Once the form is displayed, Reset on edit? is no longer considered



@SkrOYC wrote:

This means that it resets everytime a form view is opened but then not when a changed is done to other fields of the same record?



@Steve wrote:

Correct


 It seems like if it's not a Form View, the ResetOnEdit? doesn't work ๐Ÿ™„