Action buttons and forms

I have two action buttons. I want the action buttons to take me to two different Ui forms. First actuin button edits first 10 columns. Second one edits next 10. However, i chose open form to edit data and the same form opens for both action buttons. How do i link it?

Hi @Tin_Nguyen

There are various way to achieve what you want.

1st suggestion:
You may want to use a “show_if” condition on your columns, to display these according to your wish.
To do so, you will need to add a column to select the type of form you want to perform.
Let’s call this column : “formType”, type Text (you may prefer Enum…as you want).

The show_if condition on these columns will be something like:

AND(
  CONTEXT("viewType")="Form" , 
  [formType]="form1"
)

Then, in the Behavior panel, you will need to combine 2 actions:

  • action1: “set the values of some columns in this row” ==> set [typeForm] to “form1” or “form2”
  • action2: "Go to another view within this app" (expression:LINKTOFORM(...)).

…with a 3rd action:

  • action3: Execute a sequence of actions : action1 and action2

2nd suggestion:
You may also want to use 2 different forms:
In this case, you will need to set which column you want to display in each form: please pick the Column Order in the View Options of your form.
If so, your action will be only the action2: each action2_1 and action2_2 goes to each form1.

Let us know what works for you

EDIT : correction on action name for action2.

2 Likes

I created two forms. action1 and action2 opens the same form. I’m trying to redirect to the second form with the second action button.

Show how you have your Actions configured.

2 Likes

Did you set these options on your two forms ?
image

I am in the details. I have two action buttons, checkout and demo. When I click on the demo button, it still opens the checkout form. I want it to open the demo form.

Thanks @Tin_Nguyen1 for your screenshots.
Can you share the expressions you use on action buttons that opens:

  • your checkout form
  • your demo form
1 Like


I didn’t know what expression to use to open the demo UI from this demo action button.

OK.
You may want to use another action, to specify which form you want to display.
I suggest:“Go to another view within this app” and use the expression LINKTOFORM().
The result will look like that:

LINKTOFORM("yourForm", 
 "column1",
     value1,  
  "column2",
     value2
)

Please see also:

EDIT: I just noticed I indicated the wrong action name in my first post for the action2, my mistake. I made a correction.

1 Like

Ah… that was it. I knew it was there. I just couldn’t find it. Thank you!

1 Like

For my checkout, all the fields are population with the existing data. It seems like I have to link all the fields if I want it to populate. Is that correct? If I don’t link it, will the new data just override the old data?

That’s a good point.
You better try specifying in the LINKTOFORM expression all existing hidden values.
for example, if “column3” is not shown in your form1, you should use:

LINKTOFORM("form1", 
 "column3",
     value3
)
1 Like

Actually, this doesn’t work. It’s creating another row with similar data. It’s not modifying the same row like the other button.

ok. Can you try then, the 1st suggestion I made ?
with Action2 : Open a form to edit this row, this time

EDIT : @Tin_Nguyen1 Before trying my 1st suggestion, would you mind trying to add in your expression:

LINKTOFORM(“form1”,
“yourKeyColumn”,
[_THISROW],
“column3”,
value3
)

Create two form views for the table. In the first form view, use the Column order setting to include only the columns you want included in this first form. Do the same for the second form.

Configure your first action to navigate to the first form view. If the form will be used to add a new row with no need to pre-fill any form values, use LINKTOVIEW():

LINKTOVIEW("Form Responses_1")

If the form will be used to add a new row with some pre-filled form values, use LINKTOFORM(); for example:

LINKTOFORM("Form Responses_1", "Last Name", [Last Name])

If the form will be used to edit an existing row, use LINKTOROW(); for example:

LINKTOROW([_THISROW], "Form Responses_1")

Configure the second action to navigate to the second form view. This action should use LINKTOROW() in the Target expression, not LINKTOVIEW() or LINKTOFORM().

Attach the second action as the Form Saved event action fo the first form; when the user saves the first form, they will automatically navigate to the second form.

image

2 Likes