Freelance Project Requests info@CodeDocu.de Software Development in C# WPF Asp.Net Core Vba Excel Word SQL-Server EF Linq, UWP Net
#

 

 

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("https://mySite.SharePoint.com/_api/web/lists/GetByTitle('myList')/Items?$filter=ID eq '123'&$top=1“SPHttpClient.configurations.v1);

 

 

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

 

Call method:

The call can be executed using a method like this

 

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

        if(p.value[0].Pers_x00f6_nlich==true)

        {

            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

Mobile
»
SharePoint Code: Get ListItem by Code
»
Debugging with the Microsoft Browser in VS Code
»
Debugging von SharePoint in Visual Studio Code
»
Publish Install SharePoint WebPart on Server
»
Enable JS-Link for WebParts in SharePoint

.

Contact for Jobs, Project Requests: raimund.popp@microsoft-programmierer.de