---
schema_version: "1"
id: 25476dc3db4a110d288892c19a2423d67c95deaa816f1e680ae4e9c901b41844
title: Change Appointment Candidates
collection: developer
version: current
locale: en-us
portal_url: https://docs.salesforce.com/developer/current/en-us/service-cloud/salesforce-scheduler-dev-guide/guides/salesforce-scheduler/uc7-change-appointment-candidates.md
canonical_url: https://developer.salesforce.com/docs/service/salesforce-scheduler-dev-guide/guide/uc7-change-appointment-candidates.html
source_site: developer.salesforce.com
content_type: documentation
content_hash: 2b5e6089e0e20e0c0a935f104d0f9f3758b1da04e3934d88c83926d79ad063c7
products:
  - Salesforce Scheduler Developer Guide
  - Service Cloud Developer Content
---

# Change Appointment Candidates

If the assigned resources mark themselves absent, use the `query` request on the `ServiceTerritoryMember` object to show the list of alternative resources.

Create a page in your app where you can show the available service resources based on the service territory.

This sample REST API call uses the `query` request to retrieve the alternate resources.

**Resource URI**

```nolang
https://YOUR_INSTANCE.salesforce.com/services/data/vXX.X/query/?q=SELECT+EffectiveStartDate,EffectiveEndDate,ServiceResourceId,ServiceTerritoryId+FROM+ServiceTerritoryMember
```

Where `YOUR_INSTANCE` is a variable.

**Sample Response**

The API returns the available time slots and service resources.

```nolang
{
    "totalSize" : 55,
    "done" : true,
    "records" : [
  {
    "attributes" : {
      "type" : "ServiceTerritoryMember",
      "url" : "/services/data/v53.0/sobjects/ServiceTerritoryMember/0HuB0000000TalUKAS"
    },
    "EffectiveStartDate" : "2021-10-22T15:00:00.000+0000",
    "EffectiveEndDate" : null,
    "ServiceResourceId" : "0HnB0000000TbgFKAS",
    "ServiceTerritoryId" : "0HhB0000000TakhKACC"
    }, {
    "attributes" : {
      "type" : "ServiceTerritoryMember",
      "url" : "/services/data/v53.0/sobjects/ServiceTerritoryMember/0HuB0000000TaleKAC"
    },
    "EffectiveStartDate" : "2021-10-22T15:00:00.000+0000",
    "EffectiveEndDate" : null,
    "ServiceResourceId" : "0HnB0000000TbgDKAS",
    "ServiceTerritoryId" : "0HhB0000000TakhKAC"
    }, {
    "attributes" : {
      "type" : "ServiceTerritoryMember",
      "url" : "/services/data/v53.0/sobjects/ServiceTerritoryMember/0HuB0000000TaloKAC"
    },
    "EffectiveStartDate" : "2021-10-22T15:00:00.000+0000",
    "EffectiveEndDate" : null,
    "ServiceResourceId" : "0HnB0000000TbgjKAC",
    "ServiceTerritoryId" : "0HhB0000000TakhKAC"
    }
 ]
}
```

Parse the JSON response, and show the available service resources on the page so that the user can select a primary service resource.

Here’s how a **Select Service Resource** page can look.

![A representation of the Select Service Resource screen.](https://developer.salesforce.com/media/salesforce-scheduler-dev-guide/screen_primary_resource.png)

Here’s how a page can look when the user selects a primary service resource.

![A representation of the Select Service Resource screen with the primary resource selected.](https://developer.salesforce.com/media/salesforce-scheduler-dev-guide/screen_select_primary_resource.png)

On the next page in your app, show the selected primary resource. You can also show the other service resources, including assets, so that users can add them as required resources. Then, show the consolidated time slots for all the selected resources.

