0

I know that there is the process to create a filter definition, a filter activity and then have these run inside an automation to automatically update filters.

But this means that you need to completely from scratch create:

  1. The Target DE
  2. The Filter Definition (logic + Source DE)
  3. The Filter Activity Interaction (Filter Definition + Target DE)
  4. An Automation to run the Filter Activity Interaction

This seems like a LOT of things, especially since you cannot use any existing filtered DEs you created without a Filter Activity.

Is there a process that you can directly refresh a Filtered Data Extension that does not have a Filter Activity associated with it? Potentially via API so that it does not need to be reliant on an Automation in platform (SFMC)?

3

Surprisingly, there is a public facing, undocumented endpoint that will let you refresh your filtered Data Extensions as long as you have the Object ID of the Filtered DE.

Below is a quick overview on how to use this endpoint, but for more details see a post I made about this.

First point of order is how do we get this ObjectID?

GET /data/v1/customobjectdata/key/{{yourFilteredDEKey}}/rowset?$pageSize=1
Host: {{yourSubDomain}}.rest.marketingcloudapis.com
Authorization: Bearer {{oauthToken}}

Now I know this is supposed to be to return a rowset, but as there is no REST endpoint to get Data Extension properties, this was best I could find. With the pageSize set to 1, it makes the call very light processing.

Response:

{
    "links": {
        "self": "/v1/customobjectdata/token/{{yourFilteredDEKey}}/rowset?$page=1",
        "next": "/v1/customobjectdata/token/{{yourFilteredDEKey}}/rowset?$page=2"
    },
    "requestToken": "XXXXXXX",
    "tokenExpireDateUtc": "XXXXXXXX",
    "customObjectId": "{{myCustomObjectID}}",
    "customObjectKey": "{{myCustomObjectKey}}",
    "pageSize": 1,
    "page": 1,
    "count": X,
    "items": [
        {
            "keys": {
                "myKey": "00544"
            },
            "values": {
                "Field1": "40.815400000",
                "Field2": "-73.045600000",
                "Field3": "0.220696498"
            }
        }
    ]
}

So from there you just grab the 'customObjectID' in the response and move to the cool new endpoint:

POST /email/v1/filteredCustomObjects/{{myObjectID}}/refresh
Host: {{yourSubDomain}}.rest.marketingcloudapis.com
Authorization: Bearer {{oauthToken}}

When you plug your objectID into the above it should respond with something like:

{
    "id": "XXXXXXXX",
    "filterActivityInstance": {
        "id": "XXXXXXXX",
        "asyncID": 8675309
    }
}

Which shows that the DE refresh was successfully started and is now in progress.

  • I would just add that if you are going down the API route it may be better to use a query (can also be API triggered), because of the complex relationships which exist in filters things can sometimes go wrong if someone deletes the source and recreates - a query would not be affected by that kind of thing:) – Doug Aug 20 at 15:03

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.