i noticed that is not possible to group files by the columns created with scripts. Sorting is possibile but grouping is not
GROUPBY
SORTBY
It's not only for button creation. Look here too