Hi Thomas,
the basic documentation about Qapp functionality can be found here: https://www.netbraintech.com/docs/ie101/help/index.html?creating-a-qapp.htm
Internal python API docs can be found here: https://www.netbraintech.com/docs/python-api/namespaces.html
Also, for more complex topics (Qapps included) NBU is very helpful: https://nbu.netbraintech.com/#/public-dashboard
In your case, in the parameter box you can include any local variable (canvas scope - for example $this refers to the current device in loop) or global variable (Qapp wide scope - for example an input variable - https://www.netbraintech.com/docs/ie101/help/index.html?input-variables.htm)
For this exact case, to get the last device from the device queue, I believe you have to create a custom table in another canvas to which you will have to add another filed - 'last_device'. Then, pass this table to your current canvas where you can use the $last_device variable in the parameter field.
Best Regards,
Bogdan Andrus