Skip to content
This repository has been archived by the owner on Jan 20, 2024. It is now read-only.

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

Open
ryoung1872 opened this issue May 21, 2019 · 2 comments
Open

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

ryoung1872 opened this issue May 21, 2019 · 2 comments

Comments

@ryoung1872
Copy link

ryoung1872 commented May 21, 2019

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 = <simple_filter1> AND <simple_filter2>
complex_filter2 = <complex_filter1> AND <simple_filter3>
DE.search_filter = <complex_filter2>

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
Copy link

Hi, do you found a workaround for this issue?

@raferreira0520
Copy link

raferreira0520 commented Aug 8, 2022

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

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

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants