Can I change column names for form fields?

Posted by Community Admin on 04-Aug-2018 20:46

Can I change column names for form fields?

All Replies

Posted by Community Admin on 23-Feb-2015 00:00

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?

Posted by Community Admin on 26-Feb-2015 00:00

I came across this today, regarding renaming the tables:

www.sitefinitysteve.com/.../sitefinity-how-to-list

 I have no idea if it's safe or not, particularly because I don't know what the dependencies are or how to find out what they are. Also, I'd still need to rename columns as well in order to do what I need to do. 

 Anyone have any ideas?

Posted by Community Admin on 26-Feb-2015 00:00

My snippit 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.

Posted by Community Admin on 26-Feb-2015 00:00

So is there no way to change the column names?

 The reason I ask is because we have a script that runs periodically that hits a database, with a given table, and with given fields, and pulls data from it. We'd like to just set up a form, with corresponding table definition, with the same names so we don't have to ask anyone to change anything about the script, with the exception of the access info and db name. Is this in any way possible? Or do we simply need to have someone re-write that script to reflect whatever those table column names are?

Posted by Community Admin on 26-Feb-2015 00:00

In the UI no, like I said, contact support and ask them if they have a dbscript or can make one...I'm sure it's possible somehow

Posted by Community Admin on 26-Feb-2015 00:00

Ok, thanks, will do!

Posted by Community Admin on 03-Mar-2015 00:00

Hello Edward,

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.

Regards,
Ivan Eftimov
Telerik

 
Do you want to have your say in the Sitefinity development roadmap? Do you want to know when a feature you requested is added or when a bug fixed? Explore the Telerik Sitefinity CMS Ideas&Feedback Portal and vote to affect the priority of the items
 

Posted by Community Admin on 03-Mar-2015 00:00

@Ivan

  The problem isn't that he doesn't know about that, it's that it's already set the once and borked his DB table with pointless generic names like form_text_box

Posted by Community Admin on 02-Jun-2016 00:00

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.

Posted by Community Admin on 07-Jun-2016 00:00

Hello Eric,

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.

Regards,
Svetoslav Manchev
Telerik

 
Do you want to have your say in the Sitefinity development roadmap? Do you want to know when a feature you requested is added or when a bug fixed? Explore the Telerik Sitefinity CMS Ideas&Feedback Portal and vote to affect the priority of the items
 

Posted by Community Admin on 22-May-2017 00:00

Hi , 

In database there are fields name like form_text_box__c011 in form response tables ?

so my question is that how can we know that this is column is used for first_name or last_name etc. is there any link for these type of fields in database . 

thanks 

Naman Saxena

 

 

This thread is closed