1

I am trying to determine if I can use data that is set up in a related (non-sendable) Data Extension to personalize an email that I will send to a parent (sendable) data extension. I have two data extensions, one containing subscriber emails and demographic information, and the other containing sold product information. I want to be able to use the related (non-sendable) product data extension to populate data on a newsletter based on which products each subscriber has purchased, but the product data does not live in the subscriber data extension. It is only a related data extension. Is there a way that I can use this relational data to drive my content?

  • What are you using to relate these two data extensions together? Is there a shared key or field between the two? – ropedog Feb 17 at 20:07
  • 1
    I have a primary key that i have related the two data extensions together using. I have also related them in Contact Builder AND in Data Relationships (Email Studio) – Logan Kuhn Feb 17 at 20:17
3

One way to accomplish this would be to use the primary key relationship to pull in the necessary data via AMPscript. The Lookup() function would be one such example that could accomplish what you're trying to to.

    %%[

    /* Initialize variables */
    var @subPkey, @fieldFromProductDE

    /* Set the @subPkey variable to the primary key field on your sending DE */
    set @subPkey = AttributeValue("pkeyField")

    /* Use the Lookup() function to pull the productField value where DE1 primary key matches the primary key on product (in this case "productPkey") */
    set @fieldFromProductDE = Lookup("ProductDE", "productField", "productPkey", @subPkey)


    if @fieldFromProductDE == "ProductA" then
    ]%%

    Content Block A

    %%[Else]%%

    Content Block B

    %%[endif]%%


%%=v(@fieldFromProductDE)=%%

This will first pull in the primary key from your sending DE, and relate it to the primary key field on your related product DE. It will return the value from the field you've entered as your second argument in the Lookup function.

| improve this answer | |
  • I would not be able to use this data to drive dynamic content within the message, would I? Meaning, if AccountA has ProductA, show ContentBlockA and NOT ContentBlock – Logan Kuhn Feb 17 at 20:53
  • 1
    You could certainly do this through conditional 'if' statements. I've edited my answer to show an example of displaying different content based on the returned value for the "productField." – ropedog Feb 17 at 21:05

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.