Forum Discussion

EmberKrumwied's avatar
EmberKrumwied
Qrew Assistant Captain
12 months ago

Can you dynamically show/hide address map on a form?

Looking to see if it is possible to dynamically show/hide the address map on a form.  I know I can modify the field on the form to not display the map, but that is an all or nothing option.  Ideally I'd like to create a button that is "clickable" when viewing the form (not editing) which would, when clicked, either show or hide the address map.

Considered having a checkbox in the background that is updated on button press.  If box is checked, show the map, otherwise it should be hidden.  Having the map is a nice feature, but it takes up a lot of real estate.  Just trying to see if there is a way to allow the user to see a map when interested but otherwise it would be hidden.

Is something like this possible?  Thanks



------------------------------
Ember
------------------------------

1 Reply

  • The only way I could think to do this is make a second address field, and set it to show the mini map. Then use a dynamic form rule to show or hide the address field you would like (based on a checkbox that is checked/unchecked when your button is pushed).

    The catch here is there is no formula-address field so you cannot just mirror the address field. Also, you want the user to be able to edit the address field in either scenario, so you would want a scalar address field too, as your second address. You would need to use dynamic form rules, webhooks, or pipelines to auto fill and mirror your 2nd address field to your first, and vice versa. ie, if Address field 1 changes and Address 1 does not equal Address 2, change 2 to match. Then do the reverse. The 'Address 1 does not equal 2' is important or you will end up in an infinite loop of changes.

    This is that elegant, but I believe it would work.



    ------------------------------
    Mike Tamoush
    ------------------------------