0

I want to retrieve all the rows form the data extension for the matching email address. I could get the names of the columns by using below code but I am not sure how can get all the values of each row and filter with email address.

   RetrieveRequest request = new RetrieveRequest();
   request.ObjectType = "DataExtensionField";
   request.Properties =new string[]{"Name"}; 
   SimpleFilterPart sfp1 = new SimpleFilterPart();
   String[] sfp1Values = { Start.Text };
   sfp1.Property = "DataExtension.CustomerKey";
   sfp1.SimpleOperator = SimpleOperators.equals ;
   sfp1.Value = sfp1Values;
   request.Filter = sfp1;
   status = client.Retrieve(request, out requestID, out Results);

As the "DataExtensionField" retrieve request does not allow to retrieve value of the field I am not sure how to processed with this.

Thanks In advance.

1 Answer 1

0

The DataExtensionField is not what you want. I believe you're looking for DataExtensionObject.

Here's a sample SOAP envelope for retrieving a DE row:

<?xml version="1.0" encoding="UTF-8"?>
<s:Envelope xmlns:s="http://www.w3.org/2003/05/soap-envelope" xmlns:a="http://schemas.xmlsoap.org/ws/2004/08/addressing">
   <s:Header>
      <a:Action s:mustUnderstand="1">Retrieve</a:Action>
      <a:MessageID>urn:uuid:4e96dbf9-2414-4536-8d19-88726d5ea365</a:MessageID>
      <a:ReplyTo>
         <a:Address>http://schemas.xmlsoap.org/ws/2004/08/addressing/role/anonymous</a:Address>
      </a:ReplyTo>
   </s:Header>
   <s:Body xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
      <RetrieveRequestMsg xmlns="http://exacttarget.com/wsdl/partnerAPI">
         <RetrieveRequest>
            <ObjectType>DataExtensionObject[DATA-EXTENSION-EXTERNAL-KEY]</ObjectType>
            <Properties>_CustomObjectKey</Properties>
            <Properties>EmailAddress</Properties>
            <Properties>FirstName</Properties>
            <Properties>LastName</Properties>
            <Filter xmlns:q1="http://exacttarget.com/wsdl/partnerAPI" xsi:type="q1:SimpleFilterPart">
               <q1:Property>EmailAddress</q1:Property>
               <q1:SimpleOperator>equals</q1:SimpleOperator>
               <q1:Value>[email protected]</q1:Value>
            </Filter>
            <QueryAllAccounts>true</QueryAllAccounts>
            <Retrieves />
         </RetrieveRequest>
      </RetrieveRequestMsg>
   </s:Body>
</s:Envelope>

More info here.

4
  • Thanks @Adam ..but I don't want to specifically give the Column names I want a entire row matching one column.
    – CodeDiva
    Commented Feb 5, 2015 at 22:18
  • You'll have to do another call to get the column names, then literate through them when building your second call. Commented Feb 5, 2015 at 22:57
  • Thanks @Adam . Sorry for being little dumb here, but how can get the column names?
    – CodeDiva
    Commented Feb 6, 2015 at 16:56
  • @CodeDiva, I realise this is a little late, but this is really for the benefit of others. Here is a request to retrieve column names of a Data Extension. Commented May 2, 2016 at 2:33

You must log in to answer this question.

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