Opening a form with subset of row

Hi all.

I have a use case where I am in a view form of a single row of my data. I have an action button that when clicked, I want to open a new form for a user, pulling through a selection of fields they can edit.

So, I added a new form (Request Support) that has the selection of fields to edit

I added the button to the top of the original view screen for data table ‘New Legal Obligations’, with action ‘go to another view within this app’ with target
LINKTOFORM(“Request Support”, “New Legal Obligations”, [NLO Ref # (View)], “New Legal obligations”, [NLO Ref # (View)])

I can pull up the new form OK, but when saving it adds a new row of data. My intent is to edit the 2 fields already saved for that row. Is my error in the linktoform expression?

LINKTOFORM() can ONLY be used to add a row; it cannot be used to modify an existing row. To open a form view on an existing row, use LINKTOROW(). Unfortunately, though, LINKTOROW() cannot be used to set column values with the opened form.

If you want to be adventurous, you can use LINKTOFORM() to re-add the row: essentially, add a new row with the same key column value as the existing row, overwriting the existing one. You MUST explicitly set ALL of the existing row’s column values in the new row to avoid data loss; AppSheet will NOT convey data from the existing row to this new one automatically. There are other risks in more complex apps. This is an advanced technique to be used only with lots of caution and testing!

See also:

3 Likes

Thank you, @Steve
My skills (may have?) improved since starting so we’ll see how it goes :wink:

1 Like