1

I am going to give an overview of the scenario I am trying to achieve. I want to have a master DE that has subscriber details associates them to a type ID (so two columns of SubscriberID and TypeID).

I want the main DE to be non send-able and then through the API run a custom query and then create a new send-able DE based on the query results as needed. Then send an email through the API using the newly created DE as the send-able DE for that email. I was reading through the docs for EmailSendDefinition and QueryDefinition and it looks like I could probably achieve what I need with those but the docs are bad. Anybody have any examples of this or input on how the best way to make this happen?

In this example

            QueryDefinition qd = new QueryDefinition();
            qd.Name = "New Query333";
            qd.CustomerKey = "New Query Key32";
            qd.Description = "Some Description";
            qd.TargetUpdateType = "Overwrite";
            qd.TargetType = "DE";  
            qd.QueryText = "Select EMAIL_ADDRESS as EMAIL from [Example DE]";

            InteractionBaseObject ibo = new InteractionBaseObject();
            ibo.CustomerKey = "FIRST SEND";
            ibo.Name = "First Send";
            qd.DataExtensionTarget = ibo;

is qd.DataExtensionTarget = ibo; a new dataextension that will be created on the fly based on the resulk

Update: DE means data extension

5
  • 1
    What is "master DE" Aug 29, 2014 at 14:05
  • I'd suggest editing the title to be descriptive of the actual problem as opposed to "Best way to achieve scenario". That could be about any problem, and doesn't help a person when they get a search result back looking to solve a problem. Thx.
    – pchittum
    Aug 29, 2014 at 14:23
  • Understood I updated title.
    – james
    Aug 29, 2014 at 14:27
  • The sample code above will not create the ibo DE. You would have to create the DE first. What is the purpose of creating a new DE each time? Does the query change each time? Aug 29, 2014 at 18:00
  • Correct, and I actually have that query definition part working now. Now that I realize I need the DE first I am working on that part now so I can then pass to the querydefinition of which DE to fill to. When I create a new DE through the API now though I am getting a StatusMessage "The SendableSubscriberField field cannot be blank" response.
    – james
    Aug 29, 2014 at 19:20

1 Answer 1

0

I was able to achieve the above using the code but as some of the commenters have posted this only creates the query and allows you to set which DE will be populated (nor does it create the DE dynamically). To complete this you must first have the DE in place and pass the name it as the destination.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .