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

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

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

The where condition works only for segment filters. Please take a look at Email tokens · acquia/mc-cs-plugin-custom-objects Wiki · GitHub

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

1 Like