Hi Jason!
What you are looking for is the `selection` variable, I had a little snippet doing something similar that I've modified slightly for you below. It's not complete but it does at least show the concept. Hope this helps!
def launch(self, session, entities, event):
selection = event['data']['selection']
if len(selection) == 1:
entity = selection[0]
task = None
try:
task = session.query(
f'Task where id is \"{entity["entityId"]}\"'
).one()
except Exception as e:
return {
'success': False,
'message': 'An error occurred.'
}
if task:
return {
'success': True,
'message': f'Task name: {task["name"]}'
}
return False