Document.GetChildren: filter out .trashed
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎01-20-2019 02:23 AM
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.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎06-18-2019 06:41 PM
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.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎06-25-2019 07:27 AM
thanks! But no, I'm calling this as a regular API call to fetch the folder children.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎06-25-2019 03:54 PM
I don't think you can do this in a single request. This may not be helpful for your situation, but you could use NXQL search to identify the folder (ecm
