Much easier to show how this is done by showing you some code examples, so please see the link attached.