How to automate code generation for each form sent?