I managed to connect my website with sharepoint with the following code:
var siteUrl = 'mywebsite'; var targetListItem; SP.SOD.executeFunc('sp.js', 'SP.ClientContext'); var clientContext = new SP.ClientContext(siteUrl); var oList = clientContext.get_web().get_lists().getByTitle('State_Test');
Once connected I’d like to achieve two goals:
- Load all data for each category and use it as a filter (like in a dropdown button);
Could anyone give me a direction or any ideas on how I can achieve it? Any suggestions are very welcome!