Get Work Type Groups

A work type group represents a general appointment category or topic, such as a home loan or investment. Show your users your work type groupson the landing page of your app by retrieving the list of work type groups from your Salesforce instance. Your users can select a work type group from the list while booking appointments.

  1. Create a page to show your work type groups.

  2. To retrieve the list of work type groups from your Salesforce instance, use the Query() request on the WorkTypeGroup object.

    Sample Request

    1https://YOUR_INSTANCE.salesforce.com/services/data/v68.0/query/?q=
    2SELECT+Id,+Name+From+WorkTypeGroup+Where+isActive+=+true+ORDER+BY+NAME

    Where YOUR_INSTANCE is a variable.

    Sample Response

    The request returns the work type group records.

    1{
    2  "totalSize": 13,
    3  "done": true,
    4  "records": [
    5    {
    6      "attributes": {
    7        "type": "WorkTypeGroup",
    8        "url": "/services/data/v56.0/sobjects/WorkTypeGroup/0VSS700000009NdOAI"
    9      },
    10      "Id": "0VSS700000009NdOAI",
    11      "Name": "Create Account"
    12    },
    13    {
    14      "attributes": {
    15        "type": "WorkTypeGroup",
    16        "url": "/services/data/v56.0/sobjects/WorkTypeGroup/0VSS700000009YmOAI"
    17      },
    18      "Id": "0VSS700000009YmOAI",
    19      "Name": "Parent 1"
    20    },
    21    {
    22      "attributes": {
    23        "type": "WorkTypeGroup",
    24        "url": "/services/data/v56.0/sobjects/WorkTypeGroup/0VSS70000004DuiOAE"
    25      },
    26      "Id": "0VSS70000004DuiOAE",
    27      "Name": "Parent topic Create"
    28    },
    29    {
    30      "attributes": {
    31        "type": "WorkTypeGroup",
    32        "url": "/services/data/v56.0/sobjects/WorkTypeGroup/0VSS700000009YwOAI"
    33      },
    34      "Id": "0VSS700000009YwOAI",
    35      "Name": "test"
    36    },
    37    {
    38      "attributes": {
    39        "type": "WorkTypeGroup",
    40        "url": "/services/data/v56.0/sobjects/WorkTypeGroup/0VSS700000009Z1OAI"
    41      },
    42      "Id": "0VSS700000009Z1OAI",
    43      "Name": "test 32"
    44    },
    45    {
    46      "attributes": {
    47        "type": "WorkTypeGroup",
    48        "url": "/services/data/v56.0/sobjects/WorkTypeGroup/0VSS70000004DunOAE"
    49      },
    50      "Id": "0VSS70000004DunOAE",
    51      "Name": "test 32"
    52    },
    53    {
    54      "attributes": {
    55        "type": "WorkTypeGroup",
    56        "url": "/services/data/v56.0/sobjects/WorkTypeGroup/0VSS700000009ZaOAI"
    57      },
    58      "Id": "0VSS700000009ZaOAI",
    59      "Name": "Virtual WTG"
    60    },
    61    {
    62      "attributes": {
    63        "type": "WorkTypeGroup",
    64        "url": "/services/data/v56.0/sobjects/WorkTypeGroup/0VSS70000004DvWOAU"
    65      },
    66      "Id": "0VSS70000004DvWOAU",
    67      "Name": "WorkTypeGrp1"
    68    },
    69    {
    70      "attributes": {
    71        "type": "WorkTypeGroup",
    72        "url": "/services/data/v56.0/sobjects/WorkTypeGroup/0VSS700000009TvOAI"
    73      },
    74      "Id": "0VSS700000009TvOAI",
    75      "Name": "Work_Type_Group_48368"
    76    },
    77    {
    78      "attributes": {
    79        "type": "WorkTypeGroup",
    80        "url": "/services/data/v56.0/sobjects/WorkTypeGroup/0VSS700000009TqOAI"
    81      },
    82      "Id": "0VSS700000009TqOAI",
    83      "Name": "Work_Type_Group_67304"
    84    },
    85    {
    86      "attributes": {
    87        "type": "WorkTypeGroup",
    88        "url": "/services/data/v56.0/sobjects/WorkTypeGroup/0VSS700000009ZVOAY"
    89      },
    90      "Id": "0VSS700000009ZVOAY",
    91      "Name": "Work_Type_Group_96227"
    92    },
    93    {
    94      "attributes": {
    95        "type": "WorkTypeGroup",
    96        "url": "/services/data/v56.0/sobjects/WorkTypeGroup/0VSS700000009O7OAI"
    97      },
    98      "Id": "0VSS700000009O7OAI",
    99      "Name": "WTG Block Time"
    100    },
    101    {
    102      "attributes": {
    103        "type": "WorkTypeGroup",
    104        "url": "/services/data/v56.0/sobjects/WorkTypeGroup/0VSS700000009Z6OAI"
    105      },
    106      "Id": "0VSS700000009Z6OAI",
    107      "Name": "ytre"
    108    }
    109  ]
    110}
  3. Parse the JSON response, and display the work type groups on a page that you created. Your users can select a work type group for the appointment.