Action buttons and forms

Tin_Nguyen
Participant I

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?

0 20 977
20 REPLIES 20

Aurelien
Participant V

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.

Tin_Nguyen1
Participant III

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.

Did you set these options on your two forms ?
3X_7_6_76e790cd7dffeaa9171c3f3ca0152a933c67974e.png

Tin_Nguyen1
Participant III

Tin_Nguyen1
Participant III

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


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.

Ahโ€ฆ that was it. I knew it was there. I just couldnโ€™t find it. Thank you!

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
)

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
)

Steve
Participant V

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.

3X_5_7_57ff5937321c14eadb4bcb6d91d86ca0bc0e1386.png

IT WORKED! Thank you! Iโ€™m trying to understand the logic behind expressions. This makes much more sense.

Steve
Participant V
Top Labels in this Space