Showing posts with label SharePoint. Show all posts
Showing posts with label SharePoint. Show all posts

Wednesday, April 12, 2017

Basic Use Cases of for sp-pnp-js Library

Below screenshot gives examples of sp-pnp-js of how to use the library and some code snippets to read the library and update item in an library.

Get Items & Update Item























Batching



























Logging
Below code demostrates of how to subscribe for pnp logging and activate log.



Wednesday, August 26, 2015

Office 365 (SharePoint 2013 Online) - Missing results in Search Results webpart

Scenario: While building a search based application in Office 365 (SharePoint 2013 Online) , I observed a behavior which I thought was quirky. A page on a publishing site had a Search Results web part and a Content by Search web part. While configuring them, I set them to have the same query and result source.
Expected result would’ve been the exact same result set and count. But for some reason, the Content By Search web part was returning all the pages as expected but the search results web part was only returning a subset of it. What was even quirkier was that the search preview on the search results web part would display all the results.
I initially thought that some pages might not have been published and hence search results web part would not display them, but that was not the case. I started to debug what was being returned to the browser. I looked at the objects that the search results returned and did not find anything there. Starting to analyze the data, I realized all the pages that were not showing up had some content that was similar, even though they were unique pages the content had a similar tone to it. I think in the earlier versions of the Search Result Web Parts, the user had an option to “Trim Duplicates” which is no longer present in the SharePoint 2013 Search Result Web Part’s properties.
Digging a bit deeper, I found a way to set the Trim Duplicates to false.
1. Export the Search Results Web Part from your page.
2. Open the .webpart file in your favorite editor.
3. Search for “Trim Duplicates”
4. Set the Trim Duplicates property to False.
5. Upload the web part.
6. Add the web part to your page.

Thursday, April 23, 2015

SharePoint 2013 (Office 365) REST API - Supported and NOT Supported Columns

Not all types of column are available via REST, most annoyingly managed metadata columns are amongst this group of unsupported column types. Further, not all types of column will return data for an entry just by including them in the $select parameter, an example of which is Lookup (single or multi-value) columns.

ColumnSupportNotes
Hyperlink or PictureSupported
Single Line of TextSupported
Multiple lines of text :: PlaintextSupported
Multiple lines of text :: RichtextSupportedReturns unencoded XHTML
Multiple lines of text :: Enhanced RichtextSupportedReturns unencoded XHTML
ChoiceSupportedColumn is required in the $expand keyword
CounterSupported
IntegerSupported
NumberSupported
CurrencySupported
DateSupportedReturns an ISO 8601 date e.g. 2013-03-08T11:00:00
Yes/NoSupportedReturns true or false string literals
Person or GroupSupportedColumn is required in the $expand keyword, append “Id” to the column name to get the user id (UserInformationList) value inline with each entry
Person or Group (Multi)SupportedColumn is required in the $expand keyword
CalculatedSupported
ComputedSupported
Managed MetadataNot Supported
Managed Metadata (Multi)Not Supported
Publishing HTMLNot Supported
Publishing HyperlinkNot Supported
Publishing ImageNot Supported
Media FieldNot Supported
Summary LinksNot Supported
Publishing ImageNot Supported
LookupSupportedColumn is required in the $expand keyword, append “Id” to the column name to get the lookup column target id value inline with each entry
Lookup (Multi)SupportedColumn is required in the $expand keyword

Thursday, April 9, 2015

SharePoint Page Layout Error: Only Content controls are allowed directly in a content page that contains Content controls

The cause is improper case for the control tags in my page layout.  A few contorls used a lower case "c" instead of an uppercase "C" in the word content.  The page layout that had trouble had tags that looked like: instead of .  The specific offending tag is the one associated with the page title (<asp:Content ContentPlaceholderID="PlaceHolderPageTitle"runat="server">).  The solution was as simple as correcting the case of the tag name and all worked well.