function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
Ollie.ax81Ollie.ax81 

How to search for a folder

I have created a folder in the SalesForce.com UI, now I want to search for that folder through the API to get its ID so I can use the API to add documents to that folder.

I tried modifying the searchexample with

sr = binding.search("find " + folderName +
"in name fields " +
"returning " +
"folder(id)");

where folderName is the name of the folder created in the Web UI.

can I just do a search (or query) to get all the folders? I can loop through those and match my name.
DevAngelDevAngel

Hi Ollie,

Base on the describe call, the folder object is not a searchable object.  Meaning that search will not inspect it.  Use a standard SOQL statement.

 

Select Id, Name from Folder where Name = 'New Folder'

Ollie.ax81Ollie.ax81
Thanks Dave.