Search nearby addresses in a map

Search nearby addresses in a map

Requirement            

Discover specific locations on a map based on a postal code.

Use Case  

A care-taking facility wants to search for appropriate caregivers to the patients in the same postal code, which will help everyone during an emergency.

Steps to follow  

1. Create the forms with the following details:
Form
Form Link Name
Field Type
Field Name
Field Link Name
Care-Giver
Care_Giver
Name
Name
Name
Address
Address
Address
Phone
Phone
Phone_Number
Patients
Patients
Name
Name
Name
Address
Address
Address
Phone
Phone
Phone_Number
Drop Down
Age
Age

For all the Age field, the choices can be imported from Advanced > Import predefined choices > Age. This will add the default choice groups listed under the Age.

Let's insert some patients and care givers. It is imperative that they should be in the same locality so that if there is an emergency, it will be easy for the care-giver to reach the patient.
 
2. We shall create a Map report based on the Care-Givers report and name it as Care-Givers Near Me.
 

An admin who handles the allocation of patients and care-givers needs to check the locality of both to assign appropriate care persons. Hence, for every patient, we need to find the care-givers in the same locality as the patient, which can be found by filtering the Care-Givers Near Me report based on the postal code. We shall create a page and embed this report, and configure a page parameter, postalCode with which we can filter the report.
 
3. Let's create a page and embed the Care-Givers Near Me report and set its custom height to say, 850px.
 
4. Add a page parameter, postalCode.

5. Next, let's configure Filter for the embedded report. Click Configure atop the report element, then click Filter.

The report will be filtered based on the postalCode value passed to the page. The filter is in place. Now, we shall configure a report workflow to get all the care givers near a patient.

6. Select the All Patients report > Quick View > Actions and click +.
 
7. Create an action item with the following details:
 
8. Click Create Workflow, then navigate to Add New Action > Deluge Script > Create your own. Add the below script to open the Care-Givers Near Me filtered based on the current Patient record's postal code:
  1. openUrl("#Page:Page?postalCode="+input.Address.postal_Code,"same window");

9. Finally, let's add this Get Care-Givers Near Me action as a button in every All Patients record. Select the All Patients report > Quick View > Layout. In the Configure Fields slider, click Add Fields and add the action.

See how it works