Is there a way to prevent user from using back button?

I’ve needed to switch to a detail view from form views in order to save data frequently - we’ve lost data when the users keep a screen open during long routes.

I’m needing to keep the user on the screen until key data is completed and the design has worked out thus far but unfortunately the user has access to this back button where they can navigate away from the screen. I’d also like to keep them from navigating away from the screen until all required fields are entered.

Are there any ways of doing this? Thanks

1 19 1,461
  • UX
19 REPLIES 19

Bahbus
New Member

The only way I know to “disable” it, is to put the view in question on the bottom bar. Primary views always reset that spot to be the hamburger menu.

A possible trick, though I don’t know if it will work, could be placing it as a primary but then conditionally hiding it. I’m not sure what AppSheet would do in that instance.

Thanks Dave I have a few ideas on conditionally hiding it but what has worked best for you?

Bahbus
New Member

If it works, I would just put FALSE in the Show If, especially if you don’t ever want it to actually be visible on the bar.

Got it. Thanks Dave

Hi Dave, just wanted to make sure I didn’t miss anything here. I placed the form on the bottom menu to make it a “primary” view and hid the view but I’m still getting the back arrow. We simply want to make it a free-standing form and not include it in the standard navigation sequence. Is there another setting missed? .

Bahbus
New Member

Ah. Nope, seems like you did it right. But it also seems like AppSheet is too smart. It must know that it’s still hidden and therefore should show the back button.

So, new idea, try keeping everything as it is except switch the view’s Show If to: CONTEXT("View")="Route_Begin_Detail"

This should make the detail view visible on the bottom bar only if they are already on that view by some other method. That means if they click on it, nothing happens, they are already there. Because the primary view is visible, the back button should not be present and should be the menu icon instead.

No luck

Bahbus
New Member

Hmm, well then, I’m stumped. Because this is basically the opposite of a problem I helped solve a while ago. Where another user was trying to LINKTOFILTEREDVIEW to a view that was on his primary and thus was messing up his ability to go back.

I’m not sure how to force AppSheet to recognize it shouldn’t put a back button in this case. Perhaps the Show If logic is calculated after the logic for the back/menu button. In which case, does initiating a sync make the back button go away once you’re on that view already?

I’ve seen that as well. Sync will in a sense reset the form - eliminating the arrow. Since the sync disrupts the flow on the form. Is there a way to officially “close” a form - removing it from the navigation sequence? I’ve not seen anything referencing a close in AppSheet before - just thinking… I’ll try a few more things and report back for the record.

Thanks Dave

Ah, then the only suggestion I have would be to force a sync upon the initial navigation to that view. That should hopefully do it.

Hi Dave, just for the books looks like the sync did not work. I set up the following on the LINKtoView back to the Main Menu to force the sync. The system did sync but the screen still displayed the back arrow.

Well, I’m more or less completely stumped on it. I can’t think of any other settings combinations that would do it. All I know is that if the view the user is on is a primary view, AppSheet should theoretically be showing the menu button instead of back option. But, there must be some other logic issue at play. Perhaps support could shed more light on it.

(out of curiousity, did you attempt to clear your editor’s browser cache? just in case its a weird thing like that)

I’ll give clearing the cache a try Sent a note over to support too. Keep you posted.

A million thanks Dave!

Steve
Platinum 4
Platinum 4

No.

Hi @Daisy_Ramirez and @Bahbus I have the same problem. Did you find a solution to prevent user from using back button?

What I’ve done now is, I changed the view’s display name to:
Don’t press the back arrow”

3X_e_d_edf51cfd4a7ff557d2dec546fad05b302fa2d391.png

Bahbus
New Member

Nothing new from me.

Hi Fabian, I ended up “hiding” the Cancel button and displaying it only on the screens where its appropriate. Here’s the expression I have in place:

IFS(
CONTEXT(View)=“Route_Begin”," “,
CONTEXT(View)=“Route_Collection”,” “,
CONTEXT(View)=“BIN_Move_Site”,” “,
CONTEXT(View)=“BIN Move Activity”,” ",
TRUE,“Cancel”)

The Cancel option is still there so if a user presses anywhere in the area they can access it but we have not had any issues. Fingers crossed it stays that way

See where I’ve set this up below:

More efficient, especially for larger lists of possibilities, and safer:

IF(
  IN(
    CONTEXT("View"),
    LIST(
      "BIN Move Activity",
      "BIN_Move_Site",
      "Route_Begin",
      "Route_Collection"
    )
  ),
  "",
  "Cancel"
)

Perfect! Will update now – Thanks Steve!

Top Labels in this Space