Conceptually something like this should work.
Edit: %value% is a pre-defined variable which contains the value of the trigger event. There is also %device%, %date% and %time%
Reading this may help