How to iterate through Folders and sub folders of a Sharepoint Document Library using web references - sharepoint-2007

I am trying to access Folder names from Document Libraray using web services in C#.
I am to get the first level folder names using getlistitems.
Howvever i am not able to get sub folders and documents.
Can any body help me with this.

Use SiteData's EnumerateFolder method
http://msdn.microsoft.com/en-us/library/ms774758.aspx

Related

Retrieve a list of folders in SharePoint using Microsoft Graph

I’m using the graph api from a c# app to access SharePoint. I need to get a list of all folders and sub folders. I have tried getting the drive item and then iterating through the children looking for folders and then recursively working through the list but it’s too slow.
I have also tried this end point
https://graph.microsoft.com/v1.0/sites/{site-id}/lists/{list-id}/items?$expand=fields&$filter=fields/ContentType eq 'Folder'
With this header
Prefer: HonorNonIndexedQueriesWarningMayFailRandomly
But it returned that the query would consume too many resources.
Is there a way to
A. Get the folders more efficiently or
B. Do a search to return folders or
C. Only list folders in the children endpoint
You can call this endpoint to get all files and folders in the specific library:
https://graph.microsoft.com/v1.0/sites/{site-id}/lists/{list-id}/items?$expand=driveItem

Can I Use the Microsoft Graph API to get the id of folder within a sharepoint document library?

Is it possible to use the microsoft graph api to get the id of a folder within a sharepoint document library? If so, how?
I can see in the documentation that I can get the path of a folder and/or file, and make queries based on this path. But what I would like is to get an id, so if the folder and/or file ever changes name, I can still query that specific folder and/or file. Is this possible?
Specifically, I am creating an internal dashboard for my employees. We have a Folder in a sharepoint document library called "Contacts". Within this "Contacts" folder we have n number of subfolders such as "John Doe," "Jane Doe," etc. If an employee is viewing the information for John Doe within our internal employee dashboard, I'd like to display the any child folders and/or files of John Doe.
Again, all I can find in the graph api documentation is how to query based on the relative path. I'd like to be able to use the API to get an id for any folder and/or file, as well as to return any child objects of any folder using the id (and not the relative path). How can I do this?
Yes it is possible. You should use the below query
https://graph.microsoft.com/v1.0/sites/{siteid}/drives/{document libraryid}/items/{folderid}/children.
If you want to get the folder id use this call
https://graph.microsoft.com/v1.0/sites/{siteid}/drives/{document libraryid}/root/children and get the id of the folder

how to create folder in sharepoint using SSIS

Need Help!!!!
I need to load data into sharepoint from Oracle Table using SSIS.
Here Table contains Customer Information.
I have to create CustomerID as Folder and within the Folder need to load perticular Customer Details
How do i buld the Package for this.
Note: I follwed the below link, But in that example they are not explained how to create Folder.
http://msdn.microsoft.com/en-us/library/dd365137(SQL.100).aspx
Thanks,
Vijay
If you are using a document library, then you can create the folder by using the path to the document library. If you need to know the path, then go to the document lirbary -> actions -> Open in Windows Explorer. This Windows Explorer window will have the path and it responds to SSIS directory create commands.

Sharepoint's "New Folder" doesn't ask for a required field

I am using Web Part Connections to filter documents in a documents library in SharePoint. To do this, there's a column that is required, which I've named "related contact." Here's my problem: When I go add a New Folder (instead of just a document) SharePoint only asks me for a title for the Folder. The "related contact" column (which is required for the documents) doesn't even appear. Since the info on that column is empty, web part connections doesn't see the folder at all. Is there any way to make the Folder ask for another field at the time of creation?
Thanks
-V
Did you try creating a new folder content type with those required fields and trying to use that (and perhaps turn off the standard folders)?
Perhaps this page will help you: SharePoint folders and metadata.
Folders are one-dimensional. They are virtual containers for your documents, but aren't objects in your library that contain actual metadata.
Instead of using folders, I would recommend adding a column to your library that would mimic the names of the folders. From there, you can sort/filter/group/query the contents of that library. If users are sticklers for the folder structure, you could create a View that groups the documents by that new column, which would give you the appearance of folders.

Sharepoint Doc Lib Content Types

So I would like it when a user creates a new folder in my sharepoint document library that 4 template documents also get added inside the new folder. I get that the user could just click on the document template for each template individual but I want them added all the time.
There doesn't seem to be an option to add template documents to a document lib folder content type.
Sooo.... Is my only alternative to create a custom sharepoint workflow that checks for the folder creation inside my doc lib. (Ideally maybe restricting it to only when a specific folder of my custom content type is created.. ) This seems like a simple workflow to create but I want to make sure that I even need to create one since I haven't actually created a custom sharepoint workflow yet...
Thanks,
Chris
You're right; there's no built-in functionality for this. It should be reasonable simple to write a workflow that runs when something is added to a library, checks to see if it is a folder, and adds the items into the folder. It would probably be easiest to have the template documents in another folder somewhere, and then copy them over.
Good luck!
I found this example that helped out a lot:
http://www.codeproject.com/KB/sharepoint/MOSS_FolderContentTypeWF.aspx

Resources