Jump to your current location in a map view

It would be awesome if we could have a way to jump to the current location in a map view. Like we can do in google maps. 

Fabian_Weller_0-1731930143578.png

In this post I explained how to build an action that can do this. But sadly in a map view we can only put the add action and the system generated "pin" action. 

Fabian_Weller_1-1731930380551.png

We cannot put a navigation action (LinkToView).
Now I found a way how to hack the add action.

Please see my sample app "Current Location" on my Portfolio.

Here is a gif that shows how it looks like:

Show More
Current LocationCurrent Location

 

The idea:

If we use the "pin" action, it will fill the [Address] column. If we use the add action, the [Address] column will stay blank. With this in mind we can tell AppSheet what columns to show if ISBLANK([Address]) or ISNOTBLANK([Address]).

Fabian_Weller_2-1731930988955.png

What else do we need?

An action that jumps to the current location after saving the form if ISBLANK([Address]).

Fabian_Weller_4-1731931150329.png

LINKTOVIEW("Locations_Map")
&"&_currentLat="&(LAT(HERE()))
&"&_currentLng="&(LONG(HERE()))
&"&_zoom=17"

We put this action in the form as the form saved event action:

Fabian_Weller_3-1731931114714.png

And we need a bot that deletes the created row.

Fabian_Weller_5-1731931227112.png

Now the only part that I don't like is the fact, that we cannot name the save button depending on ISBLANK([Address]) or ISNOTBLANK([Address]).

Fabian_Weller_6-1731931318888.png

Maybe someone has a good idea for that problem? 😀

I'm also happy about any other input. And for sure I would be very happy if the AppSheet team would give us a more easy way to do this 😉
Here is the feature request we can upvote.

3 3 526
  • UX
3 REPLIES 3


@Fabian_Weller wrote:

Now the only part that I don't like is the fact, that we cannot name the save button depending on ISBLANK([Address]) or ISNOTBLANK([Address]).


Hi @MultiTech do you have any idea how we could do this?


@Fabian_Weller wrote:

we cannot name the save button depending on ISBLANK([Address]) or ISNOTBLANK([Address]).


You're correct:  the localization settings (which control the text you see for the Save button) does not respond quickly, only changing on the app sync, so you can't use it like you're wanting.

My solution is to build a different save button to use in the form:

  • If you use an Enum with one option, rendered as a button, then you get one large "Button" looking thing a user can press.
  • If you put this at the bottom of the form, it kinda looks like a save button
  • If you make the form auto-save... when they hit this button, the form closes and "saves"
  • If you make the enum column use a Reset on edit of `Context("ViewType") = "Form"`, then when they enter the form (and make a change) the button will reset itself back to "cleared" so the user can press it again.
    • Adding in an "editDateTime" metadata column helps here.  This column is a datetime, hidden, app formula = NOW() setup that records a timestamp anytime the row is edited.
    • Which includes entering the form (even before any edits are made).

This setup creates the illusion of a different save button at the bottom of the form.

If you implemented something like this, then you can use whatever value you want for the button - deriving it with a formula inside the suggested values space.

IF(IsNotBlank([Address]), 
  LIST("Save"), 
LIST("Can't Save")
)

 

Thank you @MultiTech Yeah I use this method in other forms.

We can go even further and hide the CANCEL and SAVE button in this form view via IF(CONTEXT("View")="The_View_Name", " ", "Save") under Localize.

The problem here is, that for the user it looks different to other forms, so it's not very nice.

Top Labels in this Space