Quantcast
Channel: SharePoint 2013 - Development and Programming forum
Viewing all articles
Browse latest Browse all 25064

How to get only list items using REST API?

$
0
0

I created an Sharepoint Hosted App where If I write a name of list and click on Submit.

It will fetch the data of that list and will show in a table.But when I enter any Library name It is also finding library as well.

Now I want to write a code where It only takes the name of list and search only list data when I enter any library name it should not search.

What should I do?

This is the code for button click

 $('#hrefList').on('click', function () {
        dynamicList = $('#txtList').val();
        AnnouncementsListQueryUrl = appweburl + "/_api/SP.AppContextSite(@target)/web/lists/getbytitle('" + dynamicList + "')/items?@target='" + hostweburl + "'&$select=EncodedAbsUrl,ID,Title,Created,AuthorId,Author/Title&$expand=Author/Title&$orderby=Created desc";
        var scriptbase = hostweburl + "/_layouts/15/";
        $.getScript(scriptbase + "SP.RequestExecutor.js", execCrossDomainRequest);
    });
});



Viewing all articles
Browse latest Browse all 25064

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>