Skip to main content
deleted 172 characters in body
Source Link
elina
  • 441
  • 5
  • 13

I have one document library, in that, I have multiple folders.

For example:

  • Foldername1/Foldername2/Foldername3/Text.docx
  • Foldername1/Text.docx
  • Foldername1/foldernmae2/Text.docx

In which folder user want to upload document they can upload.

enter image description here

enter image description here

enter image description here

enter image description here

In this images inside 18 Folder I am having Award, Closeout, and rfp. Inside these 3, I have Documents, Miscellneous, Request for proposal. Inside this I have 64 and 67.

I want to retrive the file from particular folder passing Foldernames

This is my code :

function GetDocumentName(strContractNumber, strChecklistName) {
        //in this url i want to pass strContractNumber and strChecklistName
        url = '/_api/web/lists/getbytitle(\'Contract CheckList Documents\'\'Documents\')/Items?$expand=Folder&$select=FileLeafRef,FileRef&$filter=FileLeafRef eq \'' + strContractNumber + '\'';
       alert(url)
        $.ajax({
            type: 'GET',
            headers: {
                'accept': 'application/json;odata=verbose'
            },
            async: false,

            url: url,


            success: function (data) {
            $.each(data.d.results, function (index, item) {
              var s = item.FileLeafRef;
             });
            },

            error: function (data) {
            }
        });

    }

In the url, I have to pass the strContractNumber(18) and strChecklistName(Award). Now I want to get the Test.docx document name and store that document name in one string.

I tried this but is not working

url = '/_api/Web/GetFolderByServerRelativeUrl(\'Contract CheckList Documents\'\'Documents\')/Folders';

How can i acheive this?

I have one document library, in that, I have multiple folders.

For example:

  • Foldername1/Foldername2/Foldername3/Text.docx
  • Foldername1/Text.docx
  • Foldername1/foldernmae2/Text.docx

In which folder user want to upload document they can upload.

enter image description here

enter image description here

enter image description here

enter image description here

In this images inside 18 Folder I am having Award, Closeout, and rfp. Inside these 3, I have Documents, Miscellneous, Request for proposal. Inside this I have 64 and 67.

I want to retrive the file from particular folder passing Foldernames

This is my code :

function GetDocumentName(strContractNumber, strChecklistName) {
        //in this url i want to pass strContractNumber and strChecklistName
        url = '/_api/web/lists/getbytitle(\'Contract CheckList Documents\')/Items?$expand=Folder&$select=FileLeafRef,FileRef&$filter=FileLeafRef eq \'' + strContractNumber + '\'';
       alert(url)
        $.ajax({
            type: 'GET',
            headers: {
                'accept': 'application/json;odata=verbose'
            },
            async: false,

            url: url,


            success: function (data) {
            $.each(data.d.results, function (index, item) {
              var s = item.FileLeafRef;
             });
            },

            error: function (data) {
            }
        });

    }

In the url, I have to pass the strContractNumber(18) and strChecklistName(Award). Now I want to get the Test.docx document name and store that document name in one string.

I tried this but is not working

url = '/_api/Web/GetFolderByServerRelativeUrl(\'Contract CheckList Documents\')/Folders';

How can i acheive this?

I have one document library, in that, I have multiple folders.

For example:

  • Foldername1/Foldername2/Foldername3/Text.docx
  • Foldername1/Text.docx
  • Foldername1/foldernmae2/Text.docx

In which folder user want to upload document they can upload.

In this images inside 18 Folder I am having Award, Closeout, and rfp. Inside these 3, I have Documents, Miscellneous, Request for proposal. Inside this I have 64 and 67.

I want to retrive the file from particular folder passing Foldernames

This is my code :

function GetDocumentName(strContractNumber, strChecklistName) {
        //in this url i want to pass strContractNumber and strChecklistName
        url = '/_api/web/lists/getbytitle(\'Documents\')/Items?$expand=Folder&$select=FileLeafRef,FileRef&$filter=FileLeafRef eq \'' + strContractNumber + '\'';
       alert(url)
        $.ajax({
            type: 'GET',
            headers: {
                'accept': 'application/json;odata=verbose'
            },
            async: false,

            url: url,


            success: function (data) {
            $.each(data.d.results, function (index, item) {
              var s = item.FileLeafRef;
             });
            },

            error: function (data) {
            }
        });

    }

In the url, I have to pass the strContractNumber(18) and strChecklistName(Award). Now I want to get the Test.docx document name and store that document name in one string.

I tried this but is not working

url = '/_api/Web/GetFolderByServerRelativeUrl(\'Documents\')/Folders';

How can i acheive this?

deleted 66 characters in body
Source Link
Eric Alexander
  • 43.4k
  • 10
  • 55
  • 93

I have one document library.In, in that i, I have multiple folders.

For example .1.Foldername1/Foldername2/Foldername3/Text.docx or, 2.Foldername1/Text.docx or, 3.Foldername1/foldernmae2/Text.docx:

  • Foldername1/Foldername2/Foldername3/Text.docx
  • Foldername1/Text.docx
  • Foldername1/foldernmae2/Text.docx

In which folder user want to upload document they can upload.   

enter image description here

enter image description here

enter image description here

enter image description here

In this images inside 18 Folder iI am having Award,Closeout Closeout, and rfp. inside thisInside these 3 i, I have Documents,Miscellneous Miscellneous,Request Request for proposal.Inside Inside this iI have 64 and 67.

I want to retrive the file from particular folder passing Foldernames

This is my code :

function GetDocumentName(strContractNumber, strChecklistName) {
        //in this url i want to pass strContractNumber and strChecklistName
        url = '/_api/web/lists/getbytitle(\'Contract CheckList Documents\')/Items?$expand=Folder&$select=FileLeafRef,FileRef&$filter=FileLeafRef eq \'' + strContractNumber + '\'';
       alert(url)
        $.ajax({
            type: 'GET',
            headers: {
                'accept': 'application/json;odata=verbose'
            },
            async: false,

            url: url,


            success: function (data) {
            $.each(data.d.results, function (index, item) {
              var s = item.FileLeafRef;
             });
            },

            error: function (data) {
            }
        });

    }

In the url i, I have to pass the strContractNumber(18) and strChecklistName(Award) now i. Now I want to get the Test.docx document name.

Just i want to get the document name and i want to store that document name in one string.

I tried this but is not working

url = '/_api/Web/GetFolderByServerRelativeUrl(\'Contract CheckList Documents\')/Folders';

howHow can i acheive this  ? please do needful.Thank you.

I have one document library.In that i have multiple folders.

For example .1.Foldername1/Foldername2/Foldername3/Text.docx or, 2.Foldername1/Text.docx or, 3.Foldername1/foldernmae2/Text.docx

In which folder user want to upload document they can upload.  enter image description here

enter image description here

enter image description here

enter image description here

In this images inside 18 Folder i am having Award,Closeout and rfp. inside this 3 i have Documents,Miscellneous,Request for proposal.Inside this i have 64 and 67.

I want to retrive the file from particular folder passing Foldernames

This is my code :

function GetDocumentName(strContractNumber, strChecklistName) {
        //in this url i want to pass strContractNumber and strChecklistName
        url = '/_api/web/lists/getbytitle(\'Contract CheckList Documents\')/Items?$expand=Folder&$select=FileLeafRef,FileRef&$filter=FileLeafRef eq \'' + strContractNumber + '\'';
       alert(url)
        $.ajax({
            type: 'GET',
            headers: {
                'accept': 'application/json;odata=verbose'
            },
            async: false,

            url: url,


            success: function (data) {
            $.each(data.d.results, function (index, item) {
              var s = item.FileLeafRef;
             });
            },

            error: function (data) {
            }
        });

    }

In url i have to pass the strContractNumber(18) and strChecklistName(Award) now i want to get the Test.docx document name.

Just i want to get the document name and i want to store that document name in one string.

I tried this but is not working

url = '/_api/Web/GetFolderByServerRelativeUrl(\'Contract CheckList Documents\')/Folders';

how can i acheive this  ? please do needful.Thank you.

I have one document library, in that, I have multiple folders.

For example:

  • Foldername1/Foldername2/Foldername3/Text.docx
  • Foldername1/Text.docx
  • Foldername1/foldernmae2/Text.docx

In which folder user want to upload document they can upload. 

enter image description here

enter image description here

enter image description here

enter image description here

In this images inside 18 Folder I am having Award, Closeout, and rfp. Inside these 3, I have Documents, Miscellneous, Request for proposal. Inside this I have 64 and 67.

I want to retrive the file from particular folder passing Foldernames

This is my code :

function GetDocumentName(strContractNumber, strChecklistName) {
        //in this url i want to pass strContractNumber and strChecklistName
        url = '/_api/web/lists/getbytitle(\'Contract CheckList Documents\')/Items?$expand=Folder&$select=FileLeafRef,FileRef&$filter=FileLeafRef eq \'' + strContractNumber + '\'';
       alert(url)
        $.ajax({
            type: 'GET',
            headers: {
                'accept': 'application/json;odata=verbose'
            },
            async: false,

            url: url,


            success: function (data) {
            $.each(data.d.results, function (index, item) {
              var s = item.FileLeafRef;
             });
            },

            error: function (data) {
            }
        });

    }

In the url, I have to pass the strContractNumber(18) and strChecklistName(Award). Now I want to get the Test.docx document name and store that document name in one string.

I tried this but is not working

url = '/_api/Web/GetFolderByServerRelativeUrl(\'Contract CheckList Documents\')/Folders';

How can i acheive this?

Source Link
elina
  • 441
  • 5
  • 13

How to get Documents from sharepoint Document Library passing parameters?

I have one document library.In that i have multiple folders.

For example .1.Foldername1/Foldername2/Foldername3/Text.docx or, 2.Foldername1/Text.docx or, 3.Foldername1/foldernmae2/Text.docx

In which folder user want to upload document they can upload. enter image description here

enter image description here

enter image description here

enter image description here

In this images inside 18 Folder i am having Award,Closeout and rfp. inside this 3 i have Documents,Miscellneous,Request for proposal.Inside this i have 64 and 67.

I want to retrive the file from particular folder passing Foldernames

This is my code :

function GetDocumentName(strContractNumber, strChecklistName) {
        //in this url i want to pass strContractNumber and strChecklistName
        url = '/_api/web/lists/getbytitle(\'Contract CheckList Documents\')/Items?$expand=Folder&$select=FileLeafRef,FileRef&$filter=FileLeafRef eq \'' + strContractNumber + '\'';
       alert(url)
        $.ajax({
            type: 'GET',
            headers: {
                'accept': 'application/json;odata=verbose'
            },
            async: false,

            url: url,


            success: function (data) {
            $.each(data.d.results, function (index, item) {
              var s = item.FileLeafRef;
             });
            },

            error: function (data) {
            }
        });

    }

In url i have to pass the strContractNumber(18) and strChecklistName(Award) now i want to get the Test.docx document name.

Just i want to get the document name and i want to store that document name in one string.

I tried this but is not working

url = '/_api/Web/GetFolderByServerRelativeUrl(\'Contract CheckList Documents\')/Folders';

how can i acheive this ? please do needful.Thank you.