INPUT() function Default Value not working

There have been some posts about INPUT() function Default Value not working and it seems that this is still not working. I’m talking about this:

Old syntax

INPUT("Text","Test")

New Syntax

[_INPUT].[Text]

The INPUT form should open with the default value “Test”. But it is blank.

Even if I set the Initial value to “Test” and enable Reset on edit in the column definition.

Here is a way to get this done:

  • Use a grouped action with 2 actions:
    • One that sets the desired value
    • One that opens the INPUT form
  • This works with the old and the new syntax
  • Caution: If the user clicks Cancel in the input form, the value is still written to the cell. To solve this use the Workaround from @Koichi_Tsuji

_____________________________________________________________________

_____________________________________________________________________

CC @G0ldsoul @Jonathan1 @MiguelPilo @lss @jaichith @Rifad @WillowMobileSys

2 Likes

INPUT()/[_INPUT] has always been a huge hack.

1 Like

Hi,

Can it be done?

 Pop value = " Good" expected 

If cancel or no is pressed “ blank” or “some text” to be fed.


I thought this feature was supported and wouldn’t be deprecated. Was it suddenly disabled? This will be a pain, as I’ll need to change hundreds, possibly thousands, of formulas across the app.

1 Like

I dont understand how new setup work for updating Table A from Table B using value from INPUT()

I used to do this and looks like its not working anymore.

In the action, use the following expression to access the input values: [_INPUT].[inputname]

[Let’s assume we want to ask the app user to provide the notes that will be saved in the Details column. To do so, for the Change Status action, expand the Advanced section and add an input value, such as Notes, with an initial value of n/a. For example:

Then, you can use the input value to set the value of the Details column by using the expression: [_INPUT].[Notes]

When the app user clicks the Change Status button, they will be prompted with a dialog that asks them to provide the details. ](Actions: The Essentials - AppSheet Help)

[_INPUT].[inputname]

@lizlynch Could you please bring my opening post to the attention of the engineers?

1 Like

@Fabian_Weller - I’ve opened an internal ticket to track this issue, as well. Apologies for the inconvenience.

2 Likes

So this is basically a disconnect between the original design of the INPUT function and the way people tend to expect it should work. Providing a “default value” was required both to infer the value type and to use as a fallback value in contexts where

  1. no value was bound to the input (e.g. running the action directly rather than through a ref action), and
  2. the user could not be prompted for the value (e.g. when the action was run in an automation, or the INPUT was used within a larger expression (showing a form is only supported when INPUT is the root of the expression)).

Perhaps it would have been better to call it “fallback” rather than “default”.

When the user is prompted for values, since the action is updating an existing row, the form that’s shown is basically a kind of an edit-row form where the fields initially show the preexisting values from the row. In the same way Initial Value expressions only apply to add-row forms and don’t replace existing values in edit forms, default values of inputs don’t overwrite existing values when the input form opens. However I can see how this could be unintuitive, especially when the preexisting value is blank, as “default” seems to imply pre-filling the form input.

The current behavior effectively leaves it up to the user to decide which input fields to update, as anything they don’t update retains the preexisting value. Changing it to pre-fill the form with input defaults would make it difficult to maintain this flexibility, as the user would no longer have a way to avoid updating a field that has a default. I doubt we could make such a change unless tying it to a new setting to make the new behavior opt-in.

To those of you who would prefer to see the defaults pre-filled into the form, would you expect that to happen even for fields with preexisting values, or only fields where the preexisting value is blank?

1 Like

Here’s my 2 cents… let’s see where others land here.

It should fill using default where the existing field is blank, if it already has a preexisting value, that must then display…

2 Likes

I prefer the current behavior.

@Adam-google thank you very much. I now understand that the default value is more a “fallback”.

I think you can leave it as it is. But you should enable the “Reset on Edit” for Input Forms. Then also the “Initial Value” would work in Input Forms.

We could control the “Reset on Edit” via CONTEXT(). If we want it only in form view we can use this expression in “Reset on Edit”: CONTEXT(“ViewType”)=”Form”. Otherwise we can just enable it and it would work also for Input Forms.

Otherwise we have to use the workaround in my OP.

@MultiTech what do you think?

@Adam-google

#MeToo

I also prefer the existing behavior.

With the 3 action set, we can give the initial value for input as a workaround we have.

First we place a physical column apart from column which is a target column for input action (let me call this column as TEMP column. Let me assume to pass the TODAY date for the target column input. (while the target column is null to get start)

Grouped Actions

  1. Set value of TEMP column to today().

  2. Open Input Form against TEMP Column.

  3. Pass the value from TEMP column to Target Column

    This action is only available where the target column stays NULL.

    Then create another simple INPUT action against target column whose action is only available where the target column is NOT null.

    I do have this workaround in our various apps.

@Steve

1 Like

Sorry @Koichi_Tsuji maybe I don’t understand it fully, but isn’t my workaround in my OP easier? With that we don’t need a Temp column.

Your work around is not making sense to me. Think about the case where the user cancel the action.(not save the form dialogue) Even cancel the action, then the new value is saved to the column which is not intended.

2 Likes

Thank you very much @Koichi_Tsuji I didn’t think about that. I updated my OP.

@Adam-google with that in mind I would recommend even more enabling Reset on Edit and Initial Value in input forms. With that we could do it without the workarounds.

1 Like

Thanks to everyone for the feedback, glad to see there is some support for the existing behavior.

@Fabian_Weller Regarding reset on edit, are you requesting that it should reset to the default defined in the Input? Or just run the Initial Value expression as a normal edit form would? It looks like you meant the latter, but it seems like we already do that. At least, we do at the point where the user edits something in the form. This is one difference with the regular edit form where it runs initially upon opening the form. Is that the behavior you’re referring to?

3 Likes

I would like to share my thought here. To deal with this issue, receiving manual input from the end-users, i’ve decided to follow the Appsheet design and tried to educate the end-users instead.

Here is my “workaround” solution.

  1. If there is a must to pre-fill the “default value”, then I create another Form view using the LinkToForm action, despite of having more work to do.
  2. From my point of view, displaying a “default value” is just a pin-point as a based-on value for users, and eventually, they will input a new value anyways (else the value would be automatedly entered).
    1. So, i put the “default value” in the Concatenate() in column’s Description field as a suggestion / info-service with some text as a guide and teach them / especially notify them about that.

The most important thing is to show this workaround to the users and let them understand the main purpose of doing it, well, in my cases at least. :slight_smile:

I would prefer that the behavior of a normal form view and an input form view to be the same.

So when we enable Reset on edit and enter a value in initial value this initial value should show up when we edit a row via the normal form view and when we edit via an input form view.

We could control the “Reset on Edit” via CONTEXT(). If we want it only in form view we can use this expression in “Reset on Edit”: CONTEXT(“ViewType”)=”Form”. Otherwise we can just enable it and it would work also for Input Forms.

Right now this works when we edit a row via the normal form view. But in an input form view, the Reset on edit and the initial value is ignored.

2 Likes

Hmm, it sounds like we’re getting different behavior somehow or looking at different scenarios. Here’s what I’m seeing:

  1. I have a field with an initial value and reset-on-edit enabled.
  2. If I include it in the Action assignments (so it appears in the input form) I do see its value reset to the initial value when I update some other field in the input form (the new value appears before saving the form).
  3. If I omit it from the Action assignments (so it’s not in the form) I still see its value reset after saving if I use the Input form to update some other field.
  4. I don’t see any difference between desktop, mobile or new mobile framework.

Again, one difference here vs normal edit form is that the reset only occurs after some other value changes. But it sounds like you’re not seeing the reset happen at all, even if some other value changes. Am I understanding that correctly? Can you describe the specific setup you’re working with?

2 Likes