I am trying below code to fetch list items from SharePoint and displaying in table format using REST API up to some point I have wrote the below code. I am unable to figure out how the items will be fetched or how to select columns from list items to display it in table (Suppose I do have Name, Email, Phone and ID on list items):
$.ajax({
url: `${this.props.siteUrl}/_api/Web/Lists/GetByTitle('App_Name')/items`,
type: "GET",
headers:{'Accept': 'application/json; odata=verbose;'},
success: function(resultData) {
reactHandler.setState({
items: resultData.d.results
});
},
error : function(jqXHR, textStatus, errorThrown) {
}
});
For displaying it in table format I am using react-table-component which has rows and columns value in it.