Convert d:text field to multiple values

cancel
Showing results for 
Search instead for 
Did you mean: 
skushnerenko
Active Member II

Convert d:text field to multiple values

Jump to solution

Is it possible to convert d:text field of used custom data model to multiple values?

I know that it is not possible to do in straight way, but may be there is a complex procedure.

Alfresco Community (Build: 201612)

1 Solution

Accepted Solutions
jpotts
Professional

Re: Convert d:text field to multiple values

Jump to solution

Sure, this should not be too hard. Assuming you have a property called custom:someProp, edit your model to add a new property called custom:somePropMulti (or whatever you want, but obviously it has to be unique).

Now write a script to read the values from custom:someProp and write them to custom:somePropMulti. The easiest way to do this is probably with the Alfresco JavaScript Console but you could do this with any programming language you are comfortable with. For example, you could use Java or Groovy and connect via the Apache Chemistry OpenCMIS client. Or do with with Python and cmislib, etc.

View solution in original post

2 Replies
jpotts
Professional

Re: Convert d:text field to multiple values

Jump to solution

Sure, this should not be too hard. Assuming you have a property called custom:someProp, edit your model to add a new property called custom:somePropMulti (or whatever you want, but obviously it has to be unique).

Now write a script to read the values from custom:someProp and write them to custom:somePropMulti. The easiest way to do this is probably with the Alfresco JavaScript Console but you could do this with any programming language you are comfortable with. For example, you could use Java or Groovy and connect via the Apache Chemistry OpenCMIS client. Or do with with Python and cmislib, etc.

skushnerenko
Active Member II

Re: Convert d:text field to multiple values

Jump to solution

I am just in doubt if I have a custom model with about twenty fields and I want to convert a few of them to multi value fields, the above method will result in significant increase of fields quantity.

And moreover a few of fields will remain unused after such a conversion.

But if this is the only possible solution I  use it.