Guide to set a Location Custom Field

Learn how to set a Location Custom Field on a task in ClickUp using the Google Maps and ClickUp APIs.

Before you begin

You'll need to:

  1. Create a ClickUp account.
  2. Create a Workspace.
  3. Add at least one Space, Folder (optional), and List. You can do this step using the ClickUp API!
  4. Add a Location Custom Field to the List.

Step 1: Get data from the Google Maps API.

Create a user interface for your users to input an address, and then validate their input using the Google Maps Geocoding API.

An example Geocoding API response includes the following sample data that we'll use in a later step:

Copy
Copied
{
    "formatted address": "1600 Ampitheatre Pkwy, Mountain View, CA, 94043, USA",
    "geometry": {
        "location": {
            "lat": 37.4224428,
            "lng": -122.0842467
        }
    }
}

Learn more about using the Google Maps API to validate addresses.

Now that we have an address with data from Google Maps, we can create a task in ClickUp.

Step 2: Create a new task

We're going to create a new task. In the following Try It modal, enter your personal API token in in the security section, and the List ID into the parameters section.

To find the List ID using the ClickUp API, follow this guide to explore your Workspace Hierarchy.

You can customize the request body or use the default values shown below.

Loading...

We'll use the task ID and the Custom Field ID from the response to populate the Set Custom Field request.

Update an existing task (optional)

You can set the Location Custom Field on an existing task instead of creating a new one.

You'll need the following information for step 3:

  • The task ID
  • The Custom Field ID

If you already know the task ID, you can find the Custom Field ID using the Get Task endpoint.

If you need to find an existing task using the API, you can use the following endpoints:

Step 3: Set the Location Custom Field

Now that we have the location data from Google Maps (Step 1) and the Task and Custom Field IDs from ClickUp (Step 2), we can set the Custom Field.

Note
By default, the modal below uses the Custom Field ID of the first Custom Field included in the Create Task response. You may need to update the field_id parameter to specify the Location Custom Field you want to use.

If you're using an existing task, replace the path parameters in the following Try It modal with the task ID and Custom Field ID from your existing task.

You'll need to complete Step 2 first! We need the task ID and Custom Field ID. This tells ClickUp which task and Custom Field to update.

You've successfully set a Location Custom Field in ClickUp using the Google Maps and ClickUp APIs!