Skip to content

Participant count filter

ParticipantCountFilter #

ParticipantCountFilter(
    participant_count: int, operator: ComparisonOperator
)

Bases: RapidataFilter, BaseModel

ParticipantCountFilter Class

Can be used to limit a campaign by how many users have already started a session in it. Only supported on campaigns, not on audiences.

Parameters:

Name Type Description Default
participant_count int

The participant count to compare against. Must be greater than 0.

required
operator ComparisonOperator

How the campaign's current participant count is compared to participant_count.

required

Raises:

Type Description
ValueError

If participant_count is not greater than 0.

Example

from rapidata.api_client.models.comparison_operator import ComparisonOperator
from rapidata.types import ParticipantCountFilter

filter = ParticipantCountFilter(participant_count=500, operator=ComparisonOperator.LESSTHAN)
This stops the campaign from matching any user once 500 users have started a session in it.

Source code in src/rapidata/rapidata_client/filter/participant_count_filter.py
def __init__(self, participant_count: int, operator: ComparisonOperator):
    super().__init__(participant_count=participant_count, operator=operator)