Navigate to View based on Value Added

Alex3
New Member

Hello,

Appsheet newbie. Within our app, we are adding items to a database. If the new row is a specific type, we need to we navigate to another form (after the action is saved), to enter additional data. But if the new row is a different type, the app should navigate to the existing default view.

For example:
Action: Adding New Car
Form: Car_Form

Requirement
If the โ€˜CarTypeโ€™ = โ€˜Convertibleโ€™,
Then
After saving the entry, we need to go to โ€˜ConvertibleDetails_Formโ€™ to enter additional
details (e.g. hard top, soft top, top color, etc.)

If the โ€˜CarTypeโ€™ is not โ€˜Convertibleโ€™
go to to the โ€˜CarListโ€™

Current Navigation
After a new entry is added, the system generated action is automatically taking the user to the CarList.

Question
Is there a method or expression to add navigation conditions to the system generated Save action, based on the data type (e.g. Convertible, Not Convertible)?

Thanks,

Alex

0 15 1,236
15 REPLIES 15

You could create show-if columns condition to only show those column if [CarType] = โ€œConvertibleโ€.

Your use case appears to be similar to form branching. Your use case may be different than described in the article below if your forms are on different tables so you may need navigation. However you may also take a look at the following help article that adds to the guidance of using Show_if constraint mentioned by @Heru

If you are looking for something else , please post back with more details of your requirement.

Hello,

Unfortunately, the article was not applicable to our specific use case.

  • In our use case, the forms are on different tables. Also in our use case, the first action is to create the new record
  • Based on the details of the record that was created, this new record may be part of a related child table
  • This related child table contains the details that the second form is based on

Using the car analogy:

Action: Adding New Car
Form: Car_Form

Requirements

  1. Save new car
  2. If the โ€˜CarTypeโ€™ = โ€˜Convertibleโ€™,
    Then
    After saving the entry, we need to go to โ€˜ConvertibleDetails_Formโ€™ to enter additional
    details (e.g. hard top, soft top, top color, etc.)

If the โ€˜CarTypeโ€™ is not โ€˜Convertibleโ€™
go to to the โ€˜CarListโ€™

Actions

  1. Create a new Car with Add Car Action (currently handled by a System Action)

  2. Add new Car to Car table

Navigational Branch Requirement
After creating the new car, as a new row in the Car Table, (this is currently is handled by the system action), the app needs conditional logic that either:

A. Sends the user to the ConvertibleDetails_Form
If the CarType is Convertible

Or

B. Sends the user to the CarList table
If the CarType is not Convertible

In other words,
The Form Saved event action, of the Car_Form form view, has to first add the new record to the database (Car table) and then use the logic to determine which form to navigate the user to (either the ConvertibleDetails_Form or the CarList Form).

Thank you @Alex for detailed description. As mentioned by @Steve, I believe you could use LINKTOFORM() action as event action on form save of โ€œCar-Formโ€ to navigate to โ€œConvertibleDetails_Formโ€ or 'CarList Form"

https://www.appsheet.com/samples/This-app-shows-how-to-link-to-a-form-and-fill-in-default-values?app...

Edit: Article on event actions

Hello,

There is a small piece I am missing. In the Behavior section of the form (Event Actions), I am not seeing an option or formula bar that allows me to set the conditional Navigation.

I also checked in the โ€˜Finish viewโ€™ option.

Alex

You could set the conditional nvaigation in the action itself. So you will have only one โ€œon form saveโ€ event action with an expression something like

IFS([_THISROW].[Car Type]=โ€œConvertibleโ€, LINKTOFORM(โ€œConvertibleDetails_Formโ€, โ€œCar Table Keyโ€,[Car Table Referencing Column in Child Table]), [_THISROW].[Order Status]=โ€œNot Convertibleโ€, LINKTOFORM(โ€œCarList Formโ€, โ€œCar Table Keyโ€,[Car Table Referencing Column in Child Table]))

You will need LINKTOFORM() if you wish to pass on some values (such as reference column needed to create parent and child record relation) from saved Car Table record to the ConvertibleDetails_Form or the CarList Form. Or else only LINKTOVIEW() would suffice.

Where would I put the LINKTOFORM() logic? I can create a process, but the tasks seem limited to:

  • Send mail
  • Send notification
  • Send SMS
  • Call webhook
  • Create file

I donโ€™t see a โ€œuse logicโ€ option.

Thanks,

Scott

Bots (and their Processes and Tasks) are server-side executions, they donโ€™t do anything for the user/client UI. Thus you canโ€™t use deep links like LINKTOFORM. Those are only available in Actions.

I see. Can you suggest a way to determine where to go when a record is saved based on the contents of that record? I would like to either open a different kind of record or go to the original record list based on a field value.

Thanks,

Scott

Set an Action as a Form Saved Behavior.

EDIT: โ€ฆwhich is already something that has been indicated in this thread. Perhaps you should reread this thread a bit closer.

Thanks for the idea!

Steve
Platinum 4
Platinum 4

You can create an action that navigates to the desired target an attach the action as the Form Saved event action of the Car_Form form view:

I actually was trying to do exactly that. I want to create an event action that calls LINKTOFORM when the form is saved, but I donโ€™t know how to do that. I thought I would have create a process/task, but that seems incorrect.

Scott

3X_0_7_072ab23f3d1d66a37aa08ed73c4cfccafe910742.png

Ah, I see. I was looking in a different area but understand now.

Thank you.

Top Labels in this Space