import os
from datetime import datetime
from hubspot import HubSpot
from hubspot.crm.contacts import ApiException
def main(event):
# Get today’s date
today = datetime.today().strftime(‘%Y-%m-%dT%H:%M:%S’) # Format as ISO 8601 datetime string
# Return data that can be used in later actions
return {
“outputFields”: {
“today”: today
}
}
# Lambda handler function
def hubspot_handler(event, context):
try:
# Call the main function
result = main(event)
return result
except Exception as e:
print(f"Error invoking main function: {e}")
raise
# Optional: Test the handler locally
if __name__ == “__main__”:
event = {
“object”: {“objectId”: “12345”},
“inputFields”: {}
}
context = {}
print(hubspot_handler(event, context))
then make sure to add “today” as an output
you can use this action output and update a custom property or whatever you want.
Hey @maulpaurer,
There’s an app called Tick Tock Today that would accomplish this for you! You can select an object type(s) to have the today’s date property added to. It will update the property on each record of the type you select daily.