Tuesday, April 24, 2018

S1E13: The Easy Way to code with Nasty SharePoint Search restAPI JSON

S1E13: Easy Way to code with Nasty SharePoint Search restAPI JSON



The JSON returned by the SharePoint search restAPI is just down right nasty. Because it is nasty, it will make your code nasty and unscalable.



BUT!!! With the right "data method" to encapsulate this nastiness, our existing pattern will still hold true, and we will get the power of SharePoint search...which is very powerful and widely used/needed in SharePoint Online.



Lucky for you, I've endured all of the pain for you and these 12 lines of code will save your life (i.e. heartache, head banging, cliff jumping)



   function _getSPRelevantResults(endpoint) {

            return $http.get(endpoint, _getConfig).then(function (d) {               

                var results = d.data.d.query.PrimaryQueryResult.RelevantResults.Table.Rows.results;

                var col = [];

                results.forEach(function (rItem) {

                    var item = {};

                    rItem.Cells.results.forEach(function (cell) {

                        item[cell.Key] = cell.Value;

                    });               

                    col.push(item);

                });           

                return col;

            });

        }





#spEasyDev #sp2013 #sp2016 #ngsharepoint #custommasterpage #sharepoint2013 #sharepoint2016 #sharepoint #sharepointandangularjs #odata #sharepointlargelists





Tuesday, April 10, 2018

S1E11: In 40 mins, SharePoint CSOM to Load JSON file into SharePoint Lis...

How easy it is to write CSOM C# code for SharePoint to load a JSON file and dump the content into a SharePoint list.



 We will do all of this in this 40 min video. This really sets the foundation for any integration with external systems that can be exposed with JSON. In this video we will load the JSON from a file, but with a few additional lines of code, you can do the same to load in JSON external service.



 This just one of the videos in the new series Building Custom Solutions in SharePoint the Easy way...which can be found here:
https://www.youtube.com/watch?v=2nhiAr9lplM&list=PLMLjnY5iPR3X2ZS-aIQ4nmYVd6f4la2Ni

#spEasyDev #sp2013 #sp2016 #ngsharepoint #custommasterpage #sharepoint2013 #sharepoint2016 #sharepoint #sharepointandangularjs #odata #sharepointlargelists

 


Monday, April 2, 2018

S1E10: How to Load Sample Data to create a SharePoint Large Lists - Shar...

Here is something every SharePoint Developer should be doing. Performance is always great during the initial development, but what happens when the list or library reaches  a 1000, 10K, or even 1M items? Does your code still perform well?



Some of us may be trying to stay away from SharePoint Large lists of 100,000+ items because of the havoc they may cause, or the fear of performance issues that may arise. As I stated before, 100,000 items is NOTHING for a SharePoint list or library. Microsoft designed lists and libraries to host over 20M items and documents respectively.



SharePoint Large Lists are only concerns if we are NOT designed and performance tuned for large SharePoint list. It is inevitable that lists and libraries will grow over time in SharePoint. Inefficient custom solutions will start to rear their ugly heads. TO avoid these issues, we MUST code for large list during the development process and not the maintenance process.



In this video, we will walk-through the process of generating large SharePoint list using a data-generator.



This just one of the videos in the new series Building Custom Solutions in SharePoint the Easy way...which can be found here:

https://www.youtube.com/watch?v=2nhiAr9lplM&list=PLMLjnY5iPR3X2ZS-aIQ4nmYVd6f4la2Ni