Issue in creating Dynamic Contact List by using filterFamily

pawanarora
Member

Hi Community,

I am trying to create a dynamic contact list by passing the following:

$registered_input = array(
"name" => "Testing Event - Registered",
"dynamic" => true,
"portalId" => $this->portal,
"filters" => array(
array(
array(
"operator" => "INTEGRATIONS_TIMELINE_EVENT",
"filterFamily" => "IntegrationsTimeline",
"integrationsTimelineFilter" => array(
            "eventTypeId" => $this->timeline_registration_event,
            "filterLines" => array(

                      array(
                                "filter" => array(
                                          "operator" => "EQ",
                                          "strValue" => $event_id,
                                          "property" => "event_id",
                                          "type" => "string",
                                          "filterFamily" => "IntegrationsTimeline"
                                )
                      ),
                      array(
                                "filter" => array(
                                "operator" => "EQ",
                                "strValue" => "Registered",
                                "property" => "event_registration_status",
                                "type" => "string",
                                "filterFamily" => "IntegrationsTimeline"
                      )
            )
)
)
)
)
)
);

Also, this is in array format but passed as JSON string as follows:

"contacts/v1/lists?hapikey=". $this->hapikey, $registered_input_in_json

 

It is creating a contact list but by filtering with event id only and it is not filtering with event_registration_status property. These both properties belong to Timeline.

 

Please advise me to fix it.

 

Thanks and regards,

Pawan Arora

 

 

 

0 Upvotes
3 Replies 3
Teun
Guide | Diamond Partner

Hi @pawanarora ,

 

Do you have a link to the docs regarding this API? I checked the V1 Lists API but I do not see the right operator that you are using.
I do know that when you are passing multiple filters, you need to define how they should behave, if they should be used as OR or AND.



Did my answer solve your issue? Help the community by marking it as the solution.
pawanarora
Member

Hi @Teun 

 

Sorry for late reply.

I have already gone through V1 Lists API but I did not see there how to filter the contact list by using property (token) used in timeline event template. That is - 

"filterLines" => array(

                      array(
                                "filter" => array(
                                          "operator" => "EQ",
                                          "strValue" => $event_id,
                                          "property" => "event_id",
                                          "type" => "string",
                                          "filterFamily" => "IntegrationsTimeline"
                                )
                      ),
                      array(
                                "filter" => array(
                                "operator" => "EQ",
                                "strValue" => "Registered",
                                "property" => "event_registration_status",
                                "type" => "string",
                                "filterFamily" => "IntegrationsTimeline"
                      )
            )

Here, both event_id and event_registration_status are properties used in timeline event template.

 

So, please advise me how I can fix this issue.

 

Thanks and regards,

Pawan Arora 

 

0 Upvotes
Teun
Guide | Diamond Partner

Instead of passing it multiple filters, try passing it multiple filtergroups as described in the docs.

 

When multiple filters are provided within a filterGroup, they will be combined using a logical AND operator. When multiple filterGroups are provided, they will be combined using a logical OR operator. The system supports a maximum of three filterGroups with up to three filters each.

 

So in your case, passing it multiple filterlines instead of filtergroups might be the fix?



Did my answer solve your issue? Help the community by marking it as the solution.