Share

Rename an Event

Definition: rename(new_event_name: str) → None
Description: Renames an existing Event.
Parameters: new_event_name: The new name for the specified Event.
Returns: No return value, which is indicated by None.

The following script renames an Event:

from io.hevo.api import Event

def transform(event):
    event.rename('<new name>')

    return event

Sample Transformation

The following script demonstrates how this method can be used to rename an existing Event. It:

  1. Gets the Event name.

  2. Appends the string, Results to the Event name only if the latter’s name is Student.Sheet1.

from io.hevo.api import Event

def transform(event):
    # Get event name from the event #
    eventName = event.getEventName()

    # Update the eventName
    # (This is how it will appear in the Destination)
    if eventName == 'Student.Sheet1':
        event.rename('Results.' + eventName)

    return event

Sample Output

The sample Transformation renames the Student.Sheet1 Event to Results.Student.Sheet1.

Rename Event


Last updated on Jun 30, 2023

Tell us what went wrong

Skip to the section