You can supply a javascript expression retrieveJs which will be available via Event.retrieved
retrieveJs
See here.