Share

Retrieve the Event Name

Definition: getEventName() → str
Description: Retrieves the name of the Event.
Parameters: This method does not take any arguments.
Returns: A string containing the name of the Event.

The following script retrieves the name of an Event:

from io.hevo.api import Event

def transform(event):
    # Get event name from the event #
    <event_name> = event.getEventName()

    return event

Sample Transformation

The following script demonstrates how this method can be used to filter Events named Clay County:

from io.hevo.api import Event

def transform(event):
    # Get the Event name
    eventName = event.getEventName()
    properties = event.getProperties()

    # Filter Events #
    if eventName == "Clay County":
        return None

    properties['County'] = eventName
    
    return event

Sample Output

Based on the value of eventName in the sample Event:

  • The Event is filtered if its name is Clay County:

    Filtered Event

  • A property named County is added to the Event if the name is not Clay County:

    Added Property


Last updated on May 30, 2023

Tell us what went wrong

Skip to the section