If you have a metadata field in the repository that is currently set to a type of text and there are alpha characters being used with that field, such as 1234.45DNP, and you change the type to number, what happens to the value? Does it delete the entire value? Does it just remove the no longer valid characters?
Question
Question
What happens to metadata field data when changing the data type from text to number?
Replies
I decided to run a few tests with this using Laserfiche 12 Fall 2025 release.
I started with a text field with the value 1234.50DNP and it removed the entire value and field association when I switched it to a number.
I then tried starting with a text field with the value 1234.50 and it did the same thing when I switched it to a number field.
Is there a way to switch a text field to a number and maintain the values and field associations with the entry?
Your safest way is likely via workflow. First create a second field of the type you desire and add it to the template. You will have both fields in the template at this time. Your Workflow would then search for items with the template and copy values from the 'old' field to the 'new' field. I would suggest wrapping in a try/catch to account for any outliers and mark them for later review possibly with a tag. Then once the values are copied to the desired field type you can remove the 'old' field from the template and delete it from Laserfiche. Note: you may have to clear the values before Laserfiche will allow you to delete the field since it is applied to entries and contains values.
Switching fields is not an option in this case. We would need to update millions of entries and update lots of workflows.
That's a tricky situation. Based on the behavior you're seeing, I think the only option besides workflow might involve direct changes to the database. Conversion from non-numeric to numeric types tends to be a pain.
In theory you copy all entries for that field (by prop_id) from the prop_val table into a separate table/database with columns for the original text (str_val or short_str_val depending on the field), a converted numeric value (I believe the repository database uses decimal(18,5) for the num_val column), and the appropriate identifiers (tocid and prop_id).
Once you have your data stored and converted, then you could change the data type, and "restore" the converted values into the num_val column by matching them up with the same tocid and prop_id values.
Never ideal to poke around in the database, and I've never tried anything like this on such a large scale, so there may be something I'm missing; it's a delicate task at best, but I figured I'd throw it out there anyway.