Personally I would wrap it up in a function in a service layer or some plugin maybe, nothing wrong with calling it there in the controller, just maybe better if it may be something you will or may use again if it is written as such to begin with.
My rule is, if there is a chance it could be re-used then refactor it to be re-usable.
I see… I didnt think there was anything wrong with doing it this way… But yes it makes sense to abstract it away in its own method so it can be reused.
I don’t see why not, but use the rc scope, not the form scope. rc is the proper way to access form and URL variables in ColdBox.
Also, there is a really nifty tool that helps with dynamic form fields called Form Utilities. Basically, you name your form fields as though they are structs or arrays, and this plugin will parse your form fields and actually turn the data into structs and arrays on the server side. Crazy handy for looping over unknown amounts of elements.