To get started can you try using a expression?
See if you can get it to work using a expression in the same style as in the linked post.