Forums Head Banner

Quantum Forums

Home / Inside Quantum / Forums / Development Forum / Can I change column names for form fields?

Can I change column names for form fields?

  1. admin
    admin avatar
    3 posts
    Registered:
    18 Jun 2018
    18 Jun 2018
    Link to this post
    I would like to be able to change the column names in the table that corresponds to forms I create in Sitefinity 7.3. For example, I have an input with Label consisting of "First Name". I see a read-only setting for "Advanced: Name for developers", which is set by default to FormTextBox. I'm not really sure what that is even for because the actual column in the database where this data is going is called "form_text_box". I need to change that "form_text_box" column to something like "First_Name". Can this be done?


  2. stan
    stan avatar
    3 posts
    Registered:
    18 Jun 2018
    18 Jun 2018
    Link to this post
    My snippet is to change the DB TABLE name, not the advanced name for developers...you might have to talk to support to get a script to do that.  I'm sure it's doable...
     This is one of my main SF Forms gripes, the naming sucks.  Way way back, those autogenerated (totally crappy) dev names used to be what showed up on the EXPORTS, not sure if that's still the case, but maybe.

     What needs to happen is a Regex needs to run as the user types, like on creating a page, and the Advanced name "Suggestion\Default" needs to be based on the Name\Title, not the ID or Control type...it's just insane this hasn't been addressed yet.  I mean there's always something to address, but this is (aside from no permissions) a HUGE problem with forms thats inconsistant with the rest of the CMS.

     I just tell forms editors to always open that up and remember to set the "developer name"...it's insanity.  Heck even I forget to do it sometimes...like 10 widgets on a page, maybe I forget on 1....and it's set for life.
    Last modified on 18 Jun 2018 13:06 by stan
  3. Peter Smith
    Peter Smith avatar
    4 posts
    Registered:
    18 Jun 2018
    18 Jun 2018
    Link to this post
    You can control the database column names through the Name for developers when you add the field for the first time in the form. After you publish the form which contains the newly added field, you cannot change it anymore.

    The same applies for the form Name for developers, which affects the table name which is created in the database.

    I hope this helps you achieve your solution.
  4. penny
    penny avatar
    2 posts
    Registered:
    18 Jun 2018
    18 Jun 2018
    Link to this post
    Tacking on to the end of this post since it's related.... I also needed to rename some columns on a Sitefinity 7.3 instance - when I was editing my form fields, I found the MetaField > FieldName property and tried changing the field name to something more meaningful there, which seemed to work (it changed the "Name for Developers"); however, the existing responses form appear to be missing - is there any way to get those back?  In the underlying data, it appears renaming in this way just dropped the database columns from the related form's table and never created the new columns, which is now perhaps causing an error preventing display of form responses.

  5. marketer
    marketer avatar
    2 posts
    Registered:
    18 Jun 2018
    18 Jun 2018
    Link to this post
    This scenario is not supported but you can try to add a field in the Form, which to be used from now on, changing the name for developers as per your needs, before publish the form.
    In addition on a backup project you can try to copy the old values in that new column manually, check it this works for you and remove that old field in question.

    Another option is to recreate the entire Form, which is the recommended approach, changing the name for developers in advance as per your needs. You can also use the API, if needed to transfer the available responses: http://docs.sitefinity.com/for-developers-form-responses to the new Form.