Changing a Field Type

September 9, 2017

 

 

Once a field has been defined for one of your tables in CatBase, you can change any of its properties EXCEPT the field type.

 

Oops!

 

So what can you do if you need to change a field type? Fortunately it's not too difficult. Just follow these steps:

 

  1. If you want to keep the same field name for the new field, you will first need to rename the existing field, as you can't have two fields with exactly the same name in the same table. So rename it something like myfieldOld.

  2. <Create a new field with the type and name that you need. For example, suppose you need to replace a String field with a Text field. Create a new field, choose the Field Type Text, and enter the desired field name.

  3. Save your new field.

  4. Now you need to copy the contents of the old field to the new one. This is easily accomplished with the Search & Replace function:

    1.     Go to the list view of table that the field belongs to.

    2.     Find the records that you want to change - if it's all of them, click the Show All button.

    3.     Click the Search/Replace button.

    4.     In the Search & Replace dialogue, 

      1. From the Search Field dropdown, choose the OLD field

      2.  In the Change From area, select the All Records radio button

      3.  In the Change To area, select the COPY contents TO field radio button.

      4.  In the dropdown next to that radio button, select the NEW field

      5.  Review your selections to make sure you've got them right!

      6.  Click the OK button.

      7.  Confirm that you want to change all the records by clicking Yes in the Confirm dialogue, or chicken out by clicking No.

      8.  The data will be copied from the old field to the new one.

      9.  If the new field is of a completely different type, the data will be converted as necessary. For example, if the old field is a String type and the new field is a Date type, CatBase will do its best to convert the data into proper dates.

  5. Now you just have a bit of cleaning up to do ...

    1. Change any references to the old field in your Import Styles, if necessary

      1. Go to the Import Style.

      2. Click in the column header that displays the old field name and select the new field from the dropdown.

      3. Save it.

    2. Change any references to the old field in your Publishing Styles, if necessary

      1. Go to the Publishing Stylesheet.

      2. Open the Element in which the old field is referenced.

      3. Select the new field.

      4. Save it.

    3. Replace the old field on your data entry form.

      1. Go to Admin->Table and Field Setup->Form Design Wizard.

      2. Delete the old field.

      3. Place the new field on the form.

      4. Save it.

    4. If the old field is included in the list view for the table:

      1. Go to the list view for that table.

      2. Right-click on the column heading for the old field and choose Delete Column.

      3. Right-click anywhere within the list area and choose Add a column.

      4. Select the new field.

    5. Adjust the width and placement of the new column, if necessary.

      1. Right-click on the list and choose Save the column settings for this view.

    6. Now you can go back to the table setup (Admin->Table and Field Setup) and delete the old field. You won't be able to delete it if it's still being used somewhere - eg in an Import Style or Publishing Stylesheet! 

 Further Reading ...

To learn more about adding and managing fields, see the Field Properties tutorial.

Learn more about Import Stylesheets.

Find out more about the Form Design Wizard

 

Share on Facebook
Share on Twitter
Please reload

Featured Posts

Speeding up the placement of tagged text files in Adobe InDesign

May 2, 2017

1/1
Please reload