With the following React code you can find an item from a list in SharePoint and then evaluate it


The underlying code is


 const response = await this.context.spHttpClient.get("'myList')/Items?$filter=ID eq '123'&$top=1“SPHttpClient.configurations.v1);



Then you get the following 1-line  Ein trag of anarray back

SharePoint Code: Get ListItem by Code


Call method:

The call can be executed using a method like this


var p = await  this.GetListItem("MySharePointListname","ID",123,"eq"1 );    



            return true;


        return false;



this method then returns the ListItem


public async GetListItem(listNamestringfilterFieldNamestringfilterFieldValuestringcomparatorstringtopnumberrootbasedboolean = true): Promise<any> {

        var apiUrlstring;

        if (!rootbased) {

            apiUrl = this.context.pageContext.web.absoluteUrl;


        else {

            apiUrl = this._baseUrl;



        const response = await this.context.spHttpClient.get(apiUrl +

            "/_api/web/lists/GetByTitle('" + listName + "')/Items?$filter=" + filterFieldName + " " + comparator + " '" + filterFieldValue + "'&$top=" + topSPHttpClient.configurations.v1);


        return response.json();




Im Visual Studio Code

Debugger : eines ListItems in SharePoint

SharePoint Code: Get ListItem by Code

Software Entwicklung Stuttgart NĂ¼rtingen
Suche Projekte C#, WPF, Windows App,ASP.Net, vb.Net, WinForms, SQL Server, Access, Excel