Unable to remove or delete a page property using Groovy Script.
hi,
I have a requirement where I need to update the page property type from String to String[].
Solution 1: BULK Editor
I tried using the bulk editor extension provided in the link below, which provides a custom extension to the bulk editor tool to allow saving properties of type String[], but it failed to work.
LINK --> https://www.tothenew.com/blog/aemcq5-6-bulk-editor-extension-part-1/
AEM Version -> 6.5
Solution 2: Using Groovy script.
Is there a way we can remove a page property in groovy? and then I can create a String array and re-create the same property using the code below..
if(it.hasProperty(propertyName1))
{
String v = it.get(propertyName1);
println v;
//it.remove(propertyName1);
final String[] regionArray = [v];
it.setProperty(propertyName1,regionArray);
count++;
println 'Node with Form Path =' + nodePath + ' with property '+ propertyName1 +' = ' + it.get(propertyName1);
}
However it.remove doesnt seem to work .
Solution 3: TYPE Hint
Tried using typeHInt , but would want it to apply on all existing pages using the property as well.. so not feasible
Need help to figure out a solution.
Thanks,
Samiksha

