Possibly disable PC View

Hi guys, just checking if this is possible in Appsheet.

I want to redirect the user of the app to a certain "Block Page"  via UX that I will make if the user will use PC when accessing the app, then redirect the user to the "New Log" form if uses mobile.

TIA

Solved Solved
0 9 350
1 ACCEPTED SOLUTION

Trying to use it with views is not a bullet proof way to do this. I would rather add that to table settings for example  like.. IF(CONTEXT(Host)="Device","ALL_CHANGES","READ_ONLY"). Then the user who is trying to use the app with the desktop, he/she can't do anything else than seeing the data.

View solution in original post

9 REPLIES 9

hi @agentp251113  Try this 

IFS(
CONTEXT("Device") = "Browser",
"https://yourdomain.com/block-page",
CONTEXT("Device") = "Mobile",
"https://yourdomain.com/new-log-form"
)

  1. Create a virtual column in your AppSheet table where you want to perform the redirection. Let's name it "RedirectURL."

  2. Set the column type of "RedirectURL" as "URL."

  3. Set the App formula

Hi, I tried to modify this a bit and changed the landing pages to specific views within the app

IFS(
CONTEXT("Device") = "Browser",
"View 1",
CONTEXT("Device") = "Mobile",
"View 2"
)

However, when I tried to maximize the app in my pc, it is still being landed to View 2

Do you have any other purpose of this app? Meaning.. does the app have other tables, views, functions?

Hi, I have a simple app that uses Lat Long to get the exact location of my staff so we know that they are in the office, however, some people are smart enough to use Remote Desktop and access the app in the office via desktop. So Id come up with the idea to just disable the app when being used via browser. After reading some posts, I found that there is an expression in Appsheet that uses CONTEXT("Device") = "Browser" to identify if a user is accessing the app via Desktop Browser. My main goal is to just redirect the user to a certain view within the app that has no actions so he/she wont be able to do anything in the app when used via desktop browser

Trying to use it with views is not a bullet proof way to do this. I would rather add that to table settings for example  like.. IF(CONTEXT(Host)="Device","ALL_CHANGES","READ_ONLY"). Then the user who is trying to use the app with the desktop, he/she can't do anything else than seeing the data.

Nice one Aleksi.

Just extending on your nice solution, I believe, if the expression CONTEXT(Host)="Device" is used in a view's Show_if property , those views will also not be shown to the user in desktop mode.

Thanks Alex, I would gladly use your idea and expression in my app. Cheers!

The Show_If property only hides the view button, not the view itself. Then if you are clever enough, you can see the view with the desktop with modifying the URL.

Yes, you are correct. Just that the user does not see the view also for a better, cleaner UX. The edit related disabling is anyway in place with your suggested approach.

Top Labels in this Space