Fixes #879: Formbuilder enhancement

Reduced database querying