Overview
Sometimes users may need to launch an external application from the web or mobile inbox.
When using Mirata from a mobile device, we maintain most of the functionality that a user can experience when completing a web-based form. An example of this, which will be detailed in this article, is using a button to navigate to an external site and/or application, specifically Apple Maps.
Web-Based v.s. App-Based Capabilities for Search Buttons
Traditionally, we configure the Search Button control to enable users to visit external links in a web browser from a Mirata form.
Form Controls > Actions > Search Button
During the experience of working with Search Buttons in web-based forms, users are navigated to another website which is defined when configuring the control. However, when using Mirata from a mobile device, we gain the ability to open another mobile application, rather than direct users to a website from the Safari or other browser-based app. Regardless, the configuration is the same for web-based or mobile-based deeplinking from Mirata.
The only difference is that sometimes mobile apps do not use a standard HTTP link, but rather, use a custom scheme to open from an external application (which would be Mirata in this case). If this is the scenario, the custom scheme should be entered in place of the URL property below.
For this specific use case, we are going to describe the process of deeplinking to Apple Maps via a Search Button, to automatically present driving directions to the user based on the address of a service order from a form.
Search Button Configuration Details
The first step of this process is to bring a Search Button into the form. As always, styling and presentation is at the discretion of the form builder.
URL Definition
Once the control is on the form, you will need to first configure the URL field within the Control Properties section.
Our URL to open the Apple Maps app is as shown above: https://maps.apple.com/? In the web inbox, the link would take you to the following website rather than the app.
The URL definition is important because the Search Button needs to be able to evaluate where you are looking to go. The URL definition can be treated as the BASE URL - essentially no matter whatever information you pass to the URL, this portion will remain the same every time the button is selected.
Parameter Definition
In general, whatever parameters are necessary for the external site/app can be configured by clicking the gear icon next to the Parameters property.
In order for the Apple Maps linkage in this scenario to work properly, there are three parameters that must defined within the parameters section of the Control Properties
PARAMETER NAME | PURPOSE OF PARAMETER |
|---|---|
dirflg | Direction Flag - describes the type of transportation that is taking place ex: driving v. walking |
saddr | Start Address - where you are beginning your route from |
daddr | Destination Address - where you are ending your route at |
We must configure each parameter with the following string calculations in the the Query Parameter editor window:
PARAMETER NAME | VALUE CONFIGURATION |
|---|---|
dirflg | Constant = "d" The lowercase d indicates that we are looking for directions in terms of driving |
saddr | Constant = "current+location" The current+location will evaluate to your literal current location within Apple Maps |
daddr | Field -- Address The address field may be named differently, but for this scenario, the field name is called Address |
Understanding an Example
Suppose we had an order with the Address set to the following address, 1625 Wilshire Blvd, Los Angeles, CA 90017, and we selected the button that was supposed to get us directions, we would get launched to from Mirata to Apple Maps and in a few seconds we would see driving directions from the current location to the destination address that looks like the following.
This address is for a McDonald's location in Los Angeles, no real customer data was used to create this example.
Here's an example of what it could look like on an iPad:
Here's an example of what it could look like in a web browser
For the web link for Apple Maps, the "saddr" is slightly different - if this is necessary for a specific use case, please reach out to a Mirata team member. Additionally, it may be beneficial to open the actual Apple Maps app on a computer rather than trying to use the website. In this case set the URL to maps:// - this will likely only work on a Mac unless the device has Apple Maps.