Here’s what I used to do. You can build your smart app based on this, it should be very similar:
Still, my original suggestion would have been the easiest to implement.