1

I currently using in my project:

https://github.com/salesforce-marketingcloud/FuelSDK-PHP

I don't find any documentation on how to perform a get with a complex filter:

        $myClient = new ET_Client($config);
        $dataextensionrow           = new ET_DataExtension_Row();
        $dataextensionrow->authStub = $myClient;
        $dataextensionrow->Name     = 'Transactional_SendLog22';
        $dataextensionrow->props    = array(
            'SubscriberID',                
            'unix_ts'
        );
        $dataextensionrow->filter = [
            [
                'LeftOperand'=> ['Property' => 'unix_ts','SimpleOperator' => 'greaterThanOrEqual','Value' => "1"],
                'LogicalOperator' => 'AND',
                'RightOperand'=> ['Property' => 'SubscriberID','SimpleOperator' => 'Equal','Value' => "1"]
            ]
        ];

        $results = $dataextensionrow->get();

This code is producing the following error:

SOAP-ERROR: Encoding: object has no 'Property' property in ../salesforce-mc/fuel-sdk-php/src/ET_Get.php

How am I supposed to write a filter with a logical operator with Fuel SDK for php?

2

Please check the below sample code which uses ComplexFilterPart using LogicalOperator: https://github.com/salesforce-marketingcloud/FuelSDK-PHP/blob/master/objsamples/sample-folder.php

Please make your filter line code like below:

$getFolder->filter = array(
   'LeftOperand' => 
      array('Property'=>'ParentFolder.ID','SimpleOperator'=>'equals','Value'=>'0'), 
   'LogicalOperator' => 'AND', 
   'RightOperand' => 
      array('Property'=>'ContentType','SimpleOperator'=>'equals','Value'=>'EMAIL'));

Also try to use SimpleOperator as mentioned below: https://developer.salesforce.com/docs/atlas.en-us.noversion.mc-apis.meta/mc-apis/simpleoperators.htm

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.