DLGJosh
05/15/2025, 3:37 PMCeligo AI
05/15/2025, 3:37 PMAI generated answer (using internal Slack threads):In SuiteScript, you can search for files in a folder by creating a search of type 'file'. Here is an example of how you can do this:
javascript
var fileSearchObj = search.create({
type: "file",
filters:
[
["folder","anyof", folderId]
],
columns:
[
search.createColumn({
name: "name",
sort: search.Sort.ASC
}),
"folder",
"documentsize",
"url",
"created",
"modified",
"filetype"
]
});
In the above code, replace folderId
with the internal ID of the folder you want to search in. This will return all files in the specified folder.
If you want to search for a specific file in a folder, you can add a filter for the file name. Here is an example:
javascript
var fileSearchObj = search.create({
type: "file",
filters:
[
["folder","anyof", folderId],
"AND",
["name","is",fileName]
],
columns:
[
search.createColumn({
name: "name",
sort: search.Sort.ASC
}),
"folder",
"documentsize",
"url",
"created",
"modified",
"filetype"
]
});
In the above code, replace fileName
with the name of the file you are searching for. This will return the file with the specified name in the specified folder.
******
Disclaimer:
This response was generated by an artificial intelligence assistant based on previous conversations from multiple Slack channels, and may contain inaccuracies or mistakes.
******Celigo AI
05/15/2025, 3:37 PMSlack thread 1: here (available only if the original thread was posted in the last 90 days)
Similarity score: 0.863001406
Slack thread 2: here (available only if the original thread was posted in the last 90 days)
Similarity score: 0.853341043
Slack thread 3: here (available only if the original thread was posted in the last 90 days)
Similarity score: 0.836124241
Celigo AI
05/15/2025, 3:37 PM