1

In the code below, I'm asking for and receiving all of the ListAttributes I have that are named "Prefix". One of these is a Subscriber Attribute we created in the ExactTarget UI, and we created a long list of choices to go along with it including everything from "Mr" and "Ms" to "Admiral" and "The Very Reverend". When I get the result, I get null for the RestrictedValues property. The documentation at http://help.exacttarget.com/en/technical_library/web_service_guide/objects/listattribute/ says I should get back an array of ListAttributeRestrictedValue[]. The documentation for that array is unfinished (http://help.exacttarget.com/en/technical_library/web_service_guide/objects/listattributerestrictedvalue/), but I would think that for "Prefix", my list of restricted values would be "Mr", "Ms", etc. and not null. Here is my C# code targeting the SOAP API for ExactTarget:

protected void GetListAttributes()
    {
        try
        {
            //Local variables
            APIObject[] Results;
            String requestID;
            String status;

            // Instantiate the retrieve request
            RetrieveRequest rr = new RetrieveRequest();
            rr.ObjectType = "ListAttribute";

            // Setting up a simple filter
            SimpleFilterPart sf = new SimpleFilterPart();
            sf.SimpleOperator = SimpleOperators.equals;
            sf.Property = "Name";
            sf.Value = new String[] { "Prefix" };

            //Add Filter
            rr.Filter = sf;

            rr.Properties = new string[] { "Name", "Description", "FieldLength", 
                "FieldType", "IsHidden", "IsReadOnly", 
                "MaxValue", "MinValue", "RestrictedValues", 
                "ObjectID", "DefaultValue", "Ordinal" };

            status = client.Retrieve(rr, out requestID, out Results);

            lblMessage.Text += "<br/>Total Records: " + Results.Length;

        }
        catch (Exception ex)
        {
            lblMessage.Text += ex.Message;
            lblMessage.Text += "<br/>";
        }
    }

Am I doing this wrong? Or does RestrictedValues do something other than the thing I think it should?

1
  • On Stack Overflow, no one will know what a RetrieveRequest is, or a SimpleFilterPart, or a ListAttribute, or a ObjectID. This question is awash with keywords from the SalesForce ExactTarget SOAP API. I appreciate that 5 of you agreed against my question, but I don't understand your reason. – Clay McKinney Jan 5 '15 at 15:26
0

Email from help@exacttarget.com:

"I was told that the RestrictedValue from the ListAttribute object was probably deprecated post 2009."

That is the answer to the specific question about RestrictedValue of ListAttribute. As to the broader context of trying to get picklist values from the Subscriber Profile Attributes, the answer is to use the Describe method on a Subscriber: https://help.exacttarget.com/en/technical_library/web_service_guide/technical_articles/describing_a_subscriber/

This info also came from the help email.

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.