Sep 30, 2021 4:38 PM
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
Oct 11, 2021 9:18 AM - edited Oct 11, 2021 9:19 AM
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?
Oct 1, 2021 9:11 AM
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.
Oct 4, 2021 2:38 PM
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