Link to Form HELP

Hi! I would like to have 2 prominent actions called “Make Store Visit” and “Edit Store Information”. When you are in detail view for a row, I would like to hit the first button, and it opens a form view for that row, but fills in COLUMN 1 with “X”, but when you hit the second button, it edits that row, but fills in COLUMN 1 with “Y”. How would I achieve this? Thanks!

I believe in general, you could create two different LINKTOFORM() actions with the syntax something like below

“Make Store Visit” ACTION
LINKTOFORM(“YOUR FORMVIEW NAME”, COLUMN 1, “X”, COLUMN 2, [COLUMN 2], COLUMN 3,[COLUMN 3]…,COLUMN 20, [COLUMN 20])

“Edit Store Information” ACTION

LINKTOFORM(“YOUR FORMVIEW NAME”, COLUMN 1, “Y”, COLUMN 2, [COLUMN 2], COLUMN 3,[COLUMN 3]…,COLUMN 20, [COLUMN 20])

The above expression assumes you wish to change only [COLUMN 1] values when you copy the forms. So other columns are copied with their existing value. If you wish to change [COLUMN 20] to say " Z ", then the expression will be

LINKTOFORM(“YOUR FORMVIEW NAME”, COLUMN 1, “Y”, COLUMN 2, [COLUMN 2], COLUMN 3,[COLUMN 3]…,COLUMN 20, “Z”)

2 Likes

Hi! The problem I encountered with your fix is that it does not edit the row, it creates a new row with the same values. I know this because I have a UNIQUE ID Row as key, and it said as an error that that key had already been used. This was my dilemna.

I needed to edit the row, but fill in one of the values based on which button you push. I couldn’t use link to row, because I cant customize the column values, but I cant use link to form, because it adds a row, not edits the row. Is there any way im not thinking of to get around this? Thank you! @Suvrutt_Gurjar

Use an action of type Data: set the values of some columns in this row to set the value. Once the value is set, do you still want the user to end up in the form?

yes

but I also have workflow attached to this table

To both set the column and send the user, the first approach that comes to mind is to create an action to set the column value for that row, an action to navigate to the form view of that row, a group action that performs both of those actions, and use the group action as the button.

But, your workflow might be a problem. Tell me about the workflow.

1 Like

The workflow triggers when the form is saved, and the column [New Store Visit or Edit?] is equal to “New Store Visit (Will Send Email Report)”. The first button, “Make a Store Visit”, I want to go into the form with this option selected. My other button, “Edit Store Info”, is supposed to make that equal to “Edit (Won’t send email report)”. I have actions that eventually set the value of this column to “Final Success” After the workflow has run.

1 Like

Ah, okay, so my first suggestion won’t work.

Option #2:

  1. Create two new form views, one for Make a Store Visit, and one for Edit Store Info.

  2. Go to Data >> Columns and edit the configuration for the New Store Visit or Edit? column.

  3. Set the Initial value expression to:

    SWITCH(
      CONTEXT("View"),
      "Make a Store Visit",
        "New Store Visit (Will Send Email Report)",
      "Edit Store Info",
        "Edit (Won’t send email report)",
      ""
    )
    

    Note that Make a Store Visit and Edit Store Info should match the names of the form views created in step (1).

  4. Set Reset on edit? to the expression:

    IN(
      CONTEXT("View"),
      {"Make a Store Visit", "Edit Store Info"}
    )
    

    Again, Make a Store Visit and Edit Store Info should match the names of the form views created in step (1).

The Reset on edit? expression in (4) will notice when one of the form views created in (1) are in use, and cause the Initial value expression in (3) to be reapplied to the column’s value. The Initial value expression will set the column’s value according to the view currently in use.

2 Likes