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!

0 8 813
8 REPLIES 8

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โ€)

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.

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.

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.

Top Labels in this Space