As it is, this script can only access the first level of attributes for the item class. For example, the user can't use "metadata.doc.author" as target.
I found a solution to that on this question of StackOverflow.
Step-by-step
1 - Add this function that parses the target string and returns the correct last level object:
function findprop(obj, path) {
var args = path.split('.'), i, l;
for (i = 0, l = args.length; i < l; i++) {
if (!obj[args[i]]) {
return;
}
obj = obj[args[i]];
}
return obj;
}
2 - Replace:
This line
fileSubject = ColumnData.item[columns[colName].target];
For this
fileSubject = findprop(ColumnData.item, columns[colName].target);