Hey Arne-Per!
Thanks for keeping our docs honest. It looks like that size = 0 trick works for some folders, but definitely not all! I saw the behavior you noted in tests on my own OneDrive instance.
I’m updating our docs to reflect that the metadata we currently surface doesn’t allow for differentiating around folders/files declaratively, and I’ll raise this issue with our product management team to see if we can incorporate a solution at some point.
Thanks again.
I hope you are well Cody. Thanks for the update. In case we return to One Drive (we went to Google Drive for now) did you find a work around to differentiate? I don’t mind coding it . Thanks again!
Ooooh, code you say? Well, if you insist… (He says taking off his documentation hat.)
So OneDrive seems to return different metadata for files versus folders. Rows for folders will have the folder key, while file rows will have the file key.
This is hackery, but you could probably use a snippet like this that filters your data like a condition:
const model = skuid.model.getModel(‘modelId’);
const filterTo = “folder”;
let rowsToAbandon = ;
model.getRows().forEach((row)=>{
if ( !row filterTo] ){(rowsToAbandon.push(row))}
});
model.abandonRows(rowsToAbandon);