@Paul_Millsaps
See @hkeric.wci 's code below. You should be able to adapt it if you can use a custom code widget in your function.