Page 1 of 1

SOLVED: How to change field-type of existing metadata fields?

PostPosted:Wed Feb 06, 2019 3:50 pm
by OpaHeinz
Short explanation:
For the moment, to add invoice documents I use a textfield in metadata to enter and store supplier names.
Now I uploaded a couple of invoices and assigned my metadata to it which means I assigned the supplier name and number in the described textfield.
so far so fine

Now I would like to change my textfield in a field which delivers suggestion out of still existing suppliernumbers.
Would this be possible?
If yes, how?

I assume, that I have to
1) read my still existing "supplier name" field and deliver a unique and alphabetical ordered list
2) provide this list in the metadata input mask as a selection

But what is, if I have an invoice with a new, for OpenKM unknown supplier?
In this case I should enter it again as a text....

It would be great If I could get some hints or used scenarios

Thank you in advance
rds Heinz

Re: How to change field-type of existing metadata fields?

PostPosted:Fri Feb 08, 2019 7:26 pm
by jllort
I think you are looking for enclosed list, I think a good option for you might be suggestion field : https://docs.openkm.com/kcenter/view/ok ... field.html

Re: How to change field-type of existing metadata fields?

PostPosted:Sat Feb 09, 2019 7:21 pm
by OpaHeinz
Yes, I still had a look on it.

Until now I had view hundred documents with assigned supplier by a text field.
Can I change the fieldtype for the existing/ still assigned documents?
(I don't want to loose the still assigned data)

Thank you in advance
rgds
Heinz

Re: How to change field-type of existing metadata fields?

PostPosted:Mon Feb 11, 2019 5:10 pm
by dferguson
You want to change documents with "text field data" to the equivalent which are now listed in a select list?

How about finding all the documents by group name of the text filed with a SQL query? You could then update the group name with the new group name and value. Write a script or other external program to sort based on text field value and apply the new value to match.

Re: How to change field-type of existing metadata fields?

PostPosted:Tue Feb 12, 2019 9:00 am
by OpaHeinz
yes, i did it now similar like you described.
Thank you for your help!
rgds Heinz

Re: SOLVED: How to change field-type of existing metadata fields?

PostPosted:Wed Feb 13, 2019 7:40 pm
by jllort
If you are playing in a production environment I suggest a backup.
Also, a good practice might be playing with another environment ( cloned production or OpenKM personal development environment and from there play safely ).