Modules

In Make, you can set up six different types of modules, each with a specific function.

In this tutorial, you will set up a Search module to retrieve the coordinates of an address.

The Search module sends a request and returns multiple results. Use this module when you want to let users search for records.

Inside the Search module component there are five tabs:

Communication

Information on what the engine needs to do to manage the API call (call the endpoint, process the response, pagination, etc). Remember that the following elements are inherited from the Base: base URL, error handling, log sanitize. If something needs to be changed, you can write it here, and it will override the settings of the Base component.

Static parameters

Input parameters that the user cannot map from other modules. They are only used for polling triggers, which don't have Mappable Parameters.

Mappable parameters

Input parameters in the interface that the user can either enter manually or map from the output of other modules.

Interface

Labels of the module's output added to make the output more straightforward and easy to interpret. By specifying it, there’s no need to first run the module in your scenario to get the output structure for mapping the elements.

Samples

Examples of data to help the users set up the module.

Create a Search module

To create a new module for your Geocodify app:

1

In the Modules tab, click Create Module.

2

In the pop-up window, fill in the module details. The chart below contains the values to use for your Geocodify app.

Field
Values

Template

Blank module (you will set it up from scratch)

Type

Search (to retrieve geolocalization details)

Connection

Geocodify API Key (the connection you have created earlier)

Name

geocode

Label

Search geolocation

Description

Provides longitude, latitude, and place details of a location (address, name of a place, or location).

3

Click Save.

4

Click the Mappable Parameters tab for your new search module.

5

Copy and paste the following code:

/// Defines "location" as module input parameters.
[
    {
        "name": "location_info", // Makes value accesible via "{{parameters.location_info}}".
        "label": "Location", // Sets the user friendly label visible in the module
        "type": "text", // Sets the type to text.
        "help": "Type the location you want to geolocate", // Sets the help text with an example under input field in the module.
        "required": true // Indicates this parameter is mandatory.
    }
]
Mappable parameters
Description

name

Required. Internal name of the parameter. Use it when you want to access the parameter using {{parameters.name}}.

label

Parameter name displayed in the module setup.

type

Required. Type of the parameter.

help

Instructions for the user displayed in the module setup. It supports Markdown for text formatting.

required

Specifies if the parameter is required.

6

Click Save changes.

7

Click the Communications tab for your new search module.

8

Copy and paste the following code:

{
	// Request to API endpoint.
	"url": "/geocode", // Endpoint relative to base URL
	"method": "GET",
	"qs": {
		"q": "{{parameters.location_info}}" // Required query parameter. Parameter "location_info" is defined in Mappable parameters. 
	},

	// Response handling
	"response": {
		"output": "{{body}}" // Return the body of the response
	}
}
Specification
Description

url

The API endpoint. Since it starts with /, it is joined to the base URL. Note that if the URL starts with https://, it will override the base URL.

method

The default method is GET, so it could have been omitted in this case.

qs

Query parameter containing the location to geolocate. Note that you access it by using parameters.location_info.

response

Defines the output returned, which in this case is the whole body of the response.

9

Click Save changes.

Leave all the other tabs as they are, including the Interface. This means that you won't apply any filtering or customization to the output, but all the information from the API will be returned as is.

Now you are ready to test your app.

Last updated