salesforce-marketingcloud / FuelSDK-Python

FuelSDK for python
Other
127 stars 191 forks source link

Unable to use nested filters (>2 complex operators) #112

Open ryoung1872 opened 5 years ago

ryoung1872 commented 5 years ago

It seems I am unable to use nested filters when querying my data. Code below represents my attempt to use a nested filter in the following way:

complex_filter1 = AND complex_filter2 = AND DE.search_filter =

Here is my code. Note that all of my simple filters, and those complex filters that are built up only of simple filters, work as expected:

myDEColumn = FuelSDK.ET_DataExtension_Column()
myDEColumn.auth_stub = myClient

# Complex Filter 1
customerkey_filter = {'Property' : 'DataExtension.CustomerKey','SimpleOperator' : 'equals','Value' : 'EmailSendLog'}
primarykey_filter = {'Property' : 'IsPrimaryKey','SimpleOperator' : 'equals','Value' : True}
and_custprim_filter = {'LeftOperand': customerkey_filter, 'LogicalOperator':'AND', 'RightOperand':primarykey_filter}

name_filter = {'Property' : 'Name','SimpleOperator' : 'equals','Value' : 'SubscriberKey'}

# Complex Filter 2
final_filter = {'LeftOperand': and_custprim_filter, 'LogicalOperator':'AND', 'RightOperand':name_filter}

myDEColumn.search_filter = final_filter

getResponse = myDEColumn.get()
print('Retrieve Status: ' + str(getResponse.status))
print('Code: ' + str(getResponse.code))
print('Message: ' + str(getResponse.message))
print('MoreResults: ' + str(getResponse.more_results))
print('RequestID: ' + str(getResponse.request_id))
print('Results Length: ' + str(len(getResponse.results)))
print('Results: ' + str(getResponse.results))

I get the following message error when running this code:

Retrieve Status: False Code: HTTPStatus.OK Message: Error: The Filter Property '' is not a retrievable property. MoreResults: False RequestID: 0e981ef6-21a9-429e-b6b7-34b594a1435f Results Length: 0 Results: []

ulinares commented 3 years ago

Hi, do you found a workaround for this issue?

raferreira0520 commented 2 years ago

Hey, any update on this? I have the same issue

When trying to use a 'LeftOperand' inside a previous 'LeftOperand' the error returns