# Custom Objects - how to use the "where" clause in the email token

**URL:** <https://forum.mautic.org/t/custom-objects-how-to-use-the-where-clause-in-the-email-token/27449>\
**Category:** 3rd Party Addons\
**Created:** [March 21, 2023, 7:04pm UTC](https://forum.mautic.org/t/custom-objects-how-to-use-the-where-clause-in-the-email-token/27449 "2023-03-21T19:04:53Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![erthal](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mautic.org/erthal/32/6285_2.png) [@erthal](https://forum.mautic.org/u/erthal)\
**Post date:** [March 21, 2023, 7:04pm UTC](https://forum.mautic.org/t/custom-objects-how-to-use-the-where-clause-in-the-email-token/27449/1 "2023-03-21T19:04:53Z")

</div>

Hi Folks,

need some help on custom objects. Here´s a customobjects items retrievied from a contact:

```
"customObjects": {
  "data": [
    {
      "id": 3,
      "alias": "evento",
      "data": [
        {
          "id": 1899,
          "name": "Nome",
          "language": null,
          "category": null,
          "isPublished": true,
          "dateAdded": "2023-03-21T17:10:13+00:00",
          "dateModified": "2023-03-21T17:10:13+00:00",
          "createdBy": 8,
          "modifiedBy": 8,
          "attributes": {
            "dataevento": "2023-04-18",
            "idwebinar": "86970030241",
            "linkinscricao": "https://link.clickcompliance.com/2",
            "participacao": "2",
            "link-certificado": "",
            "certificado": ""
          }
        },
        {
          "id": 1485,
          "name": "Os novos programas de compliance na Lei nº 14.457/2022: as obrigações com que as empresas com CIPA devem cumprir",
          "language": null,
          "category": null,
          "isPublished": true,
          "dateAdded": "2023-02-24T17:30:21+00:00",
          "dateModified": "2023-02-24T17:30:21+00:00",
          "createdBy": 8,
          "modifiedBy": 8,
          "attributes": {
            "dataevento": "2023-03-22",
            "idwebinar": "81021417635",
            "linkinscricao": "https://link.clickcompliance.com/1",
            "participacao": "2",
            "link-certificado": "",
            "certificado": ""
          }
        }
      ],
      "meta": {
        "sort": "-dateAdded",
        "page": {
          "number": 1,
          "size": 10
        }
      }
    }
  ],
  "meta": {
    "sort": "-dateAdded",
    "page": {
      "number": 1,
      "size": 10
    }
  }
}

```

As you can see there´s 2 items on the “evento” structure. How to build a email token that will retrieve only the item with idwebinar equals 81021417635 ?

I keep trying some syntax alternatives but it only returns my latest item:

{custom-object=evento:linkinscricao|  
where=evento:idwebinar=81021417635 | order=latest | limit=1 | default= | format=default}

Unfortunaly there´s no examples in [Custom objects — Acquia Docs](https://docs.acquia.com/campaign-studio/settings/custom-objects/#using-custom-objects-in-email-tokens)

@silavapi @escopecz or @fedy can you help me?

---

<div class="post-metadata">

**Author:** ![escopecz](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mautic.org/escopecz/32/370_2.png) [@escopecz](https://forum.mautic.org/u/escopecz)\
**Post date:** [March 22, 2023, 1:19pm UTC](https://forum.mautic.org/t/custom-objects-how-to-use-the-where-clause-in-the-email-token/27449/2 "2023-03-22T13:19:11Z")

</div>

The where condition works only for segment filters. Please take a look at [Email tokens · acquia/mc-cs-plugin-custom-objects Wiki · GitHub](https://github.com/acquia/mc-cs-plugin-custom-objects/wiki/Email-tokens#where-conditions)

So in order to do what you want you need to send the email to a segment that has filter on evento:idwebinar=81021417635
