Changing a Field Type

Updated: Jan 22, 2020

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


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:

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

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

  7. Click the Search/Replace button.

  8. In the Search & Replace dialogue,

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

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

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

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

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

  14. Click the OK button.

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

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

  17. 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.

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

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

  20. Go to the Import Style.

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

  22. Save it.

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

  24. Go to the Publishing Stylesheet.

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

  26. Select the new field.

  27. Save it.

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

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

  30. Delete the old field.

  31. Place the new field on the form.

  32. Save it.

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

  34. Go to the list view for that table.

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

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

  37. Select the new field.

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

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

  40. 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

#fields #fieldtypes

59 views0 comments
crown commercial service logo
Adobe technology partner logo
4D silver partner logo
  • Facebook Social Icon
  • Twitter Social Icon
  • YouTube Social  Icon

© Copyright 2020 CatBase Publishing Systems Ltd.