0

A contact Key can be in multiple data extensions. I was wondering if there's a way to retrieve through the APIs all the data extensions a contact key is in?

EDIT: We foresee our marketers creating many filtered data extensions of users, and then we would like to call an API to find which data extensions a user is in. Is that the right way? Is there a better way of doing this?

2

It is not possible, but if you want to remove a contact, Contact Deletion Framework will remove a contact key across all sendable data extensions

| improve this answer | |
  • Thanks for that, but it's because we foresee our marketers creating many filtered data extensions of users, and then we would like to call an API to find which data extensions a user is in... – mercifulhop May 8 '19 at 8:03
1

If you are thinking only about Filtered Data Extensions from a Main Data Extension, then it is possible.

You know that the fieldnames from the Main Data Extension (the DE that all filtered DEs were created from) will be copied to all Filtered data extensions. This makes it a lot easier because once you have determined all relevant DEs, you can perform the exact same lookup into each.

so: Build a loop to retrieve all existing Data extensions. The limit here is 2500 in one retrieve, but you can circumvent this if necessary, or maybe filter for some common traits.

https://developer.salesforce.com/docs/atlas.en-us.noversion.mc-programmatic-content.meta/mc-programmatic-content/ssjs_WSProxy_advanced_retrieve.htm

For each retrieved DE, you would check if a field with the fieldname that holds the key in your Main DE exists. If yes, Then perform a simple lookup for the specific user key you are looking for in the field that holds the Contact Key in your Main data Extension.

| improve this answer | |
  • Thanks for that, I'll give it a shot! – mercifulhop May 10 '19 at 5:02
  • 1
    This is a huge amount of processing. I am not sure that this would be a scalable solution and on large accounts will definitely time out on a CP or script activity. – Gortonington May 10 '19 at 15:57

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.