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.

   Name = "firstname"
   Value = None
   Name = "lastname"
   Value = None


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,

    att_2 = { 'Name':att_name,

#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 ?



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.


| improve this answer | |

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.