I am trying to pull SharePoint List Data as JSON so I can populate it to a JavaScript template library.
I have used this script to test in a SharePoint Script Editor just to make sure the JSON posts to the console, and nothing is posted to the console and no errors appear.
Here is my fetch script:
<script>
var fullUrl = _spPageContextInfo.webAbsoluteUrl + "/_api/web/lists/getbytitle('WeeklyReport1')/items?$select=Team,WeekOf,OffensiveReport,DefensiveReport,SpecialTeamsReport";
const getItems = () => {
return fetch('fullUrl')
.then(res => res.json())
.then(posts => console.log(posts))
}
</script>