So the Fields and Variables form constructor is very cool. is there a way to invoke it in a procedure so it is automated?
Yes there is.
This is actually the code that the Fields and Variables constructor dialog uses when you press the Construct button, so the results are identical. The dialog simply provides a place for you to create/edit the template, then runs this statement, but you can do it yourself in a procedure.