4

I'm using the Python FuelSDK. Works well - I can do all the usual functions listed in the API docs. I've read through many of the SE posts and all the docs.

I can filter on top level field names in the subscriber object, however, I'm stumped on how to create a filter that applies to subscriber attributes. In the subscriber object, the 'Attributes' key points to an array of dicts, each of which contains two 'Name':name, 'Value' key / value pairs and the order of items is variable.

(Attribute){
   Name = "firstname"
   Value = None
 }
(Attribute){
   Name = "lastname"
   Value = None
 }

etc

In my python code I can't seem to figure out the right way to filter on these. I've tried many permutations of the following in order to filter on the Attribute {'Name':'Is_Subscribed_to_Newsletter','Value':'True'}.

   att_name = "Is_Subscribed_to_Newsletter"
    att_value = "True"

    att_1 = {"Attributes":
             { 'Name':att_name,
               'Value':att_value
              }
        }

    att_2 = { 'Name':att_name,
           'Value':att_value
           }

#tried variations of these, att_1 and att_2

    subscriber.search_filter =  {'Property': 'Attributes','SimpleOperator' : 'equals','Value' : att_1}  

    subscriber.search_filter =  {'Property' : "{Attributes:{'Name':'Is_Subscribed_General_Newsletter'}}",'SimpleOperator'\
 : 'equals','Value' : 'True'}

Anyone have luck on the exact right formatting of the filter ?

Thanks!

1 Answer 1

2

Unfortunately, filtering on profile attributes is not possible. This is a limitation of the SOAP API which the Python SDK uses.

One option would be to utilize Data Extensions instead of lists as they allow for a lot more flexibility when it comes to retrieving records and have other benefits as well.

https://help.exacttarget.com/en/documentation/exacttarget/solution_guides/using_a_list_versus_a_data_extension/

You must log in to answer this question.

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