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

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?

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? .

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

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

1 Like

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.

1 Like

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 :slight_smile: Sent a note over to support too. Keep you posted.

A million thanks Dave!

No.

1 Like