Tom, I will try something like what you are doing, but I'll have to write it to get values from ns_conn rather than Template.