Retrieve the Event Name

Last updated on May 30, 2023
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

Revision History

Refer to the following table for the list of key updates made to this page:

Date Release Description of Change
Feb-14-2023 NA New document.

Tell us what went wrong