Document.GetChildren: filter out .trashed
Is it possible to have Document.GetChildren not return .trashed files? By default they are included:
{
"path": "/test/The Basics.pdf._1547968140071_.trashed",
"uid": "44cf396c-dbe3-4e21-8886-e0a1d3a76a91",
"properties": {},
"title": "The Basics.pdf",
"type": "File"
}
The @children operator on the other hand, does not include them by default.
Hi Milan,
Is the Document.GetChildren being called in an automation chain? If you are trying to filter out .trashed versions, this can be accomplished via the RunScript operator.
First create a new automation chain that is empty.
In the automation chain, run Document.GetChildren from the FetchedDocument
Set a RunScript operator and use something like this in the script
var childpath = Document.path;
if(childpath.split('.').pop()) == 'trashed') {
Context['isTrash'] = "true";
}
else {
}
After this RunScript operator, use a RunOperation operator that checks the variable 'isTrash'. If it's true, then redirect to that empty automation chain so it doesn't do anything with it. However if it's false, then proceed with your expected next operator to process the non-trashed child document.
Hope this helps.