Showing posts with label Craig Pilkenton. Show all posts
Showing posts with label Craig Pilkenton. Show all posts

Friday, February 5, 2016

Making SharePoint Search Results even better for your users

If you've only ever had even just a cursory glance at any SharePoint 2013 or SharePoint On line demo, you'll have noticed the nice-looking Search Results that come Out-of-Box nowadays with their sleeker look and hover previews of the documents themselves.  With the latest features we have access to numerous new components that make our results look better for end users, much easier for Power Users to change, and especially easier for us developer's to enhance than the black magic we had to use on previous versions (XML, XSLT was not your friend).
 
These new capabilities have allowed for Search-driven pages to be built out where all the links and information can be pulled directly from the Search Index instead of just List Views.
 
 
Just to review, here's a quick rundown of the features we've been able to leverage right away since the launch.
  • Delegated Search enhancements by Site Collection / Site (don't need to be a Farm Admin any more!)
  • FAST Search is integrated into enterprise search
  • New Search Web Parts: Search Results Web Part, Refinement Web Part or Panel, and Content Search Web Part
  • Result Types & Display Templates, Result Sources , and Query Rules
  • List or Library on-demand full crawl
  • Continuous Crawl, if you have the hardware and need for the freshest results
Search display templates have been decoupled in this version so that we have Control Display Templates to structure the overall layout for how we want to present the search results, while Item Display Templates determine how each item in the result set will be displayed.  There's also Item Hover Display Templates that show Page or document previews, but that's a different topic for another day.  For this article we'll just be targeting the Item templates as the standard structure is just fine.
 
But as with anything related to SharePoint, there's always more that can be enhanced to make our end users happier, and Search Results are no exception.  In this article, I'm going to show how easy it is to grab document / List metadata that's already being indexed and then update our Search Page results with that data.  My example is using a Search Results Web Part on a Page that has it's settings modified to just pull the latest document updates in the Site (no Keyword Search Box), but these template updates automatically apply to those setups that have a Search Box Web Part too.
 
I'm going to have the Last Modified date show on all results, as it should be part of every default template, in my humble opinion.  We'll also add in a Managed Metadata column that's attached to a specific Document Library, but only build a table of the data if the result comes from that Library.
 
Note:  To accomplish these updates you'll need to be a Site Collection Admin if you want to apply this for all your Sites/SubSites, or at least a Site Owner to make changes for just your Site.
 
Find your data
This will start out being the hardest part of the exercise as it's up to us (or from user requests) to determine what extra data we want to show, mapping it up in the Search Schema, and then figuring out how to display it.
 
Now that I've made you nervous, let's just jump in and take our first step to determine what extra data we want to show in our Search Results.  Usually it's a metadata column in our Document Library's that describes where, when, or how to use this document in some situation or project.  In my case I was asked to show the Template Type and Service Type data in the result item when any of the documents from this Library showed up.  While these are Managed Metadata columns, any type of data that is attached to an item can be used.
 
 
So now that we know what data is needed, it's time to put on our detective hat and go look for it in SharePoint's Search Schema, which is a collection of Crawled Properties of everything stored in our Sites that are then sometimes automatically mapped to Managed Properties for use (Site Columns assigned to Document Library's and Managed Metadata columns). To utilize indexed values in Search Results, we need to find or create the Managed Property that is mapped to a Crawled item.  When you go into Site Settings, under the Search header click on the Schema link.
 
 
Once in the properties interface, it will default to showing all the Managed Properties SharePoint creates OoB (Out-of-Box).  In the Search box, we'll type the beginning of one of the columns from the Document Library above, remembering that less text is more results and that SharePoint abhors spaces in column names (it replaces them with "_x0020_") and will fix them for you.
 
In the image below, you can see that our query returned the Managed Property we need called 'owstaxIdTemplateType', that is set for a Mapped Crawled Property named 'ows_taxId_TemplateType'.  This is where the detective work comes in if the target column wasn't given a name that is specific enough.  In this case I know the column/crawled property is a Managed Metadata column (e.g. "..._taxId_..."), and that the column was created with no spaces so that must be the one I want.
 
Now that we have our Managed Property, we need to look at the different attributes applied to them, such as Type, Query, Search, and Refine as well as others.  What we're looking for is to ensure that our property has the word "Retrieve" in the Retrieve column, otherwise we won't be able to show it's values in our updated results.  If it doesn't, we'll have to create our own Managed Property, but that's another article in the future.
 
 
Setup a Result Type
Whew, that was a lot of work finding our column in the index, but now that we have it things start getting easier.  Our next step is to copy an existing Item Template and change it from there (no sense in re-inventing the wheel).  I use SharePoint Designer 2013 and the Site Settings menu's for this, but you can use standard file explorer as noted in Design Manager capabilities (yet another article for the future).
 
To start our template copy, we first need to see what template SharePoint is using currently.  Back in Site Settings under the Search heading, click on the Result Types link. 
 
 
This will load the menu showing all the Display Templates by type, assigned to results that SharePoint shows for us.  We'll be creating versions for all the document types that are in our Library, but I'll just start with Excel for now.  Also, on the far right under Result Actions, notice that it says it uses 'Excel Item' which is what we'll need later to make a template copy.  Hover over the item, then in the hover dropdown, select the Copy function.
 
Note:  It's always best practice to make a copy of SharePoint objects and not update the original directly.  You never know if an update from Microsoft will help out and overwrite your changes.
 
 
Once the Edit Result Type page loads, in the name box append some text to explain how it's different (e.g. Site it's attached to, group, application, etc.) and note the sources it's hooked to and what type of content it matches are automatically selected.  Under the Actions is a "What should these results look like?" dropdown that is hooked to Excel Item already.  We'll update this with our new template later, but for now we have our entry for displaying results differently.  Click the Save button to create the entry which will post back to the Manage Result Types page showing our new entry.
 
 
 
Create & Enhance your (Item) Display Template
With our new Result Type created, we need to now create a copy of the core 'Excel Item' template to update and then attach.  We'll open SharePoint Designer to our Site URL then click on the All Files object in the left pane to show everything.  Since the templates are kind of hidden by SharePoint click on the _catalogs folder, then the masterpage folder, the Display Templates folder, and finally the Search folder.  This is the physical-ish location of all the Control and Item Display Templates.
 
 
Since SharePoint likes to keep things interesting, the Title of our target is 'Excel Item' but the file name pattern is reversed, as 'Item_Excel.html'.  The other interesting piece is you'll notice a .html AND a .js version of these files.  This new decoupled model takes our HTML template and compiles it down to JavaScript for us as we save and uses that JavaScript file when rendering the results.  So to make our version to work with, right-click on only the .html version of these files and select the Copy function, then right-click anywhere in the Library and choose the Paste function.  Once Designer finishes creating the copy in the Library at the bottom, rename it's file name by removing "copy(1)" and appending a distinctive name, as well as updating the Title column to the right (otherwise you'll see the "Excel Item" template twice when we go back into Site Settings and won't know which to pick).
 
 
Now we need to right-click on only our new .html file and select 'Check-Out', and then 'Edit File in Advanced Mode' to open it for editing.
 
 
With the file open in Edit mode, locate the XML node labeled "mso:ManagedPropertyMapping" near the top.  This is where we add in our Managed Property that we want the template to show.  You'll see that the syntax is pretty easy in that you put property name, colon, and a descriptive name for it (,'xxx':'xxx') at the end of the node with both pieces surrounded by single quotes.  I always just use the property name in the descriptor to make life easier.  In our case here, I'm adding in the value ",'owstaxIdServiceType':'owstaxIdServiceType'" just before the closing tag of the XML node.
 
After you update the Managed Property node, scroll down to just under the HTML that says <div id="Item_Excel">.  Here you'll see what looks like JavaScript comment tagging, but with extra pieces; _# and #_.  This is part of SharePoint's new compiler marking that tells it what to rebuild down into the .js file.  In the upper highlighted section I add in my Javascript where I set a few variables to use those new Managed Property's we added above, then evaluating if they're empty to determine whether to create my display table (checking if this item is in my Library where that metadata is set).  Finally, near the bottom of the file under SharePoint's default HTML I add in 2 new HTML elements for the dynamic table, and the Last Modified date that I want to show all the time.  Make sure you save and close the file when done.
 
Note:  To show the JavaScript in the HTML we have to surround our variables with the compiler notation mentioned above. " _#variable-name-here#_"
 
 
Update the Search Settings
Our next step is to go back to the browser in Site Settings and under the Web Designer Galleries heading, click on the Master Pages and Page Layouts link.  Here we'll Check-In and Publish a major version of the new template.
 
 
This will drop us into the Library where all the templates and layouts are stored.  Double-click on the Display Templates folder, then the Search folder.  This is where all the Control and Item Display Templates live within the Site Collection.  After paging to the 2nd set of results we'll see our new .html Item Template showing right around the existing one we copied from.  Hover over just the .html file and in the hover dropdown, select the Check In function.
 
 
Once the Check-In modal loads, select the 1.0 Major version (publish) choice that will make this version visible to everyone else once we've updated our Result Type.  In the template library we won't see the file as Checked-Out anymore.
 
 
The last admin step is that we need to go back to Site Settings and under the Search heading, click on the Result Types link.  Hover over our new Result Type until the dropdown menu appears and select the Edit function.
 
 
Once the page loads, we'll see all the settings from before when we copied the existing one, but now that we have our Item Display Template created we're going to update Search Results to use it.  Scroll down until you see the section Actions > 'What Should These Results Look Like?' and select the dropdown.  In there we should see our new "Excel Item - BP" listed alphabetically right around the original (that's why we updated the Title to find it).  Select this new item, then click the Save button.
 
Note:  Under the dropdown you'll see a disclaimer about the latest properties in your template will update if you make changes.  This applies to any new Managed Properties you add into your template.  See next paragraph on this.
 
 
The page will now post back to the Manage Result Types where you can review and verify that Excel results will now use our custom Item Display Template.  One thing to note from the below image is that every time you update your template and Publish a new Major Version, you have to come back here to do a Properties Sync (you won't see it initially following my instructions).  This forces SharePoint to push your latest template into the cache for users to see.  Otherwise you'll be beating your head on the keyboard trying to figure out why your new metadata isn't showing up!
 
 
Users Applaud your awesome-ness
Now that we've updated all Excel results to use our stellar new template, navigate to the page that you're showing Search Results on and verify your work.  We should see that now every Excel result has at least the Last Modified date showing as we don't have any conditional logic around it being there.  But if the result has that metadata attached to it, our new table will be built out with that metadata for our users.  Now you can sit back and bask in your rockstar-ness for making a small change with big impacts.
 
 
While this may not seem like a big thing for all the steps above, it can help your users find information they didn't know they might be looking for, and if you've set this value up as a Refiner they can find more excellent resources like this by filtering or searching by it.   The big return here is cutting down the time they spend searching for content and finding exactly what they needed right away.
 
 
 
References:
What’s new in Microsoft SharePoint Server 2013 - Support.Office.com
 
Introducing Search Schema for SharePoint 2013 - TechNet
 
Overview of the search schema in SharePoint Server 2013 - TechNet
 
Understand SharePoint Crawled and Managed properties for search - ShareGate Blog
 

by Craig Pilkenton via Everyone's Blog Posts - SharePoint Community

Thursday, January 7, 2016

Working with Azure AD using Powershell

Helping organizations move to the Office 365 / Azure cloud requires good explanations, deep planning, and usually some automation to make migration easier.  During an engagement there was a need to implement account synchronization in Azure AD (Active Directory) before Microsoft's DirSync tool was installed and ready to go.  Crazy talk you might say, but Powershell was able to handle this with ease.

To get started solving this, I had to understand how connecting to Azure AD is handled, what the available cmdlets were, and how the user data is represented coming back.

Getting started
Starting out, there are a few prerequisites we need to connect up to an Azure instance.  Your Windows 8 desktop (or greater) will work just fine, but eventually you may move this to any Windows Server 2008 R2 or greater as PowerShell is available by default anymore.

  • Install PowerShell 3.0, if it's not already present
  • Install the Microsoft Online Services Sign-In Assistant to broker security
  • Install the Azure AD Module
  • An Azure AD logon name and password to login as

After all these are installed, launch the Azure Active Directory shell as this loads all the cmdlets available and removes the need to run the Import-Module cmdlet from normal Powershell.

Connect to Azure AD with credentials
Inside the shell, we need to first create a connection to our Azure AD instance using the Sign-In Assistant from before.  To do this we have to create a Credential object by encoding our username and password.  Finally, we call the Connect-Msolservice cmdlet to initiate the connection.  Note:  if you're not saving this as a .ps1 file for reuse, then you can just call Connect-MSolservice which will pop a logon box.

$strAAdLogon = "xxx@xxx.onmicrosoft.com"
$strAAdPassword = "xxx"
$password = convertto-securestring -String $strAAdPassword -AsPlainText -Force
$cred = new-object -typename System.Management.Automation.PSCredential -argumentlist $strAAdLogon, $password
Connect-Msolservice -credential $cred

Using the above variables and code PowerShell attempts to connect to the instance.  Note: if no error's show (red text) and the command prompt is ready for input, then you connected correctly.  That's the only indicator's for you.

Get Tenant instance information
With our instance now connected, we can get some information to see details about our instance.  You can use this to verify you're in the right Tenant and any details.

The first command is Get-MsolCompanyInformation, which gives us all the high-level details on our Tenant and some synchronization information.

PS C:\> Get-MsolCompanyInformation
DisplayName                              : XXX
PreferredLanguage                        : en
Street                                   : 123 S Someroad Street
City                                     : Charlotte
State                                    : NC
PostalCode                               : 00000
Country                                  :
CountryLetterCode                        : US
TelephoneNumber                          : 111-222-3456
MarketingNotificationEmails              : {}
TechnicalNotificationEmails              : {xxx@xxx.com}
SelfServePasswordResetEnabled            : True
UsersPermissionToCreateGroupsEnabled     : True
UsersPermissionToCreateLOBAppsEnabled    : True
UsersPermissionToReadOtherUsersEnabled   : True
UsersPermissionToUserConsentToAppEnabled : True
DirectorySynchronizationEnabled          : True
LastDirSyncTime                          : 1/7/2016 1:08:26 PM
LastPasswordSyncTime                     : 10/7/2014 5:45:36 AM
PasswordSynchronizationEnabled           : True

The Get-MsolDomain cmdlet is used to retrieve company domains, their status, and what type of authentication they use.

PS C:\> Get-MsolDomain
Name               Status          Authentication
----                        ------          --------------
xxx.com                     Verified        Federated
xxx.xxx.com                 Verified        Federated
xxx.onmicrosoft.com         Verified        Managed
xxx.mail.onmicrosoft.com Verified        Managed

Get a list of Groups
Now that we know were working in the right Tenant, calls can be made to see what AD Groups are already in the sytem.

The Get-MsolGroup cmdlet is used to retrieve groups from Azure AD. This cmdlet will be used next to return a single group (if ObjectId is passed in), or to search within all groups by using PowerShell's pipeline feature to search something.

PS C:\> Get-MsolGroup
ObjectId                               DisplayName          Description
--------                               -----------          -----------
8f16927f-2bbb-47c9-9b34-7a0ab3af74a6   DnsUpdateProxy       DNS clients who ...
1cbabadd-f241-4928-9135-e2eb11383cce   DnsAdmins            DNS Administrato...
6fa5d7ba-88a1-453a-8800-2f0ac102b2a4   WinRMRemoteWMIUse... Members of this ...
af0891f5-17dc-4cf4-b7d1-9e2a6eeee71e   XXX ACS Aut...   Test group creat...
e982a6f0-5676-427c-841a-6893f6a0e695   DL-Tester            DL-Tester

Get a list of users in a group
Once we have an ObjectId from one of our groups, we can call it specifically to see all the users of that group.

The Get-MsolGroupMember cmdlet is used to retrieve members of the specified group. The members can be either users or groups.

PS C:\> Get-MsolGroupMember -GroupObjectId e982a6f0-5676-427c-841a-6893f6a0e695
GroupMemberType  EmailAddress            DisplayName
---------------     ------------            -----------
User                sallysupport@xxx.com  Sally Support


Get a specific user
Finally, we have a few specific users to look at to see their individual attributes.  To retrieve more than just the standar properties I'll pipe the object to the Select command.

The Get-MsolUser cmdlet can be used to retrieve an individual user, or list of users. An individual user will be retrieved if the ObjectId or UserPrincipalName parameter is used.

PS C:\> Get-MsolUser -UserPrincipalName sallysupport@slalomdev.com | Select DisplayName, LastName, F irstName, ObjectId, isLicensed

DisplayName : Sally Support
LastName    : Support
FirstName   : Sally
ObjectId    : 5bb30da2-96a0-47a6-b99f-79d8460922e4
IsLicensed  : True

Conclusion
And that gives us enough informamtion to start wrapping our heads around the storage methods.  Using the above Azure AD cmdlets I was able to start looking at users that had already been created in the system to understand how synchronizing new users into the Azure AD should happen to ensure the accounts are linked.

References

by Craig Pilkenton via Everyone's Blog Posts - SharePoint Community

Wednesday, July 29, 2015

Managing SharePoint Online with Powershell

In the course of Slalom helping clients move to the Office 365 cloud, I routinely use Powershell and it's SharePoint Online cmdlets (Office 365 & Azure AD cmdlets too!) to help manage their Tenant, both before and after migrations.  While the UI contains all the tools for managing an instance, it immediately becomes tedious to click through the same actions for more than a few actions.
While the amount of cmdlets are lagging in quantity in comparison to On-Premises SharePoint, we are given several that can help us save deployment and management time.  Below we'll walk through getting connected and then doing routine query transactions.
--Getting started
To get started there a few prerequisites needed to start connecting with SharePoint Online.  You can connect from either a desktop or server, depending on where you have access to.
  • Install PowerShell 3.0, if it's not already present (Server 2012 or Windows 8)
  • Install the SharePoint Online Management Shell, which will have the cmdlets we need
  • URL of your SharePoint Online Admin center (e.g. "http://ift.tt/1o7xudm", etc.)
  • An Office 365 account that has Global Administrator privileges
After all these are installed, launch the SharePoint Online Management shell as this removes the need to run the Import-Module cmdlet.  Here's the code we'll be working from in this example.
--Connect to SharePoint Online with credentials
Now that we're ready with the SharePoint Online shell, the first thing we need to do is create a Credential object.  On Line 1 below we call the Get-Credential cmdlet which pops a logon box for us to put our "xxx@xxx.onmicrosoft.com" and password, pushing that into an object for later use.  I then create a variable to store my Admin URL on Line 2 as well.
Using the above variables I then call the Connect-SPOService cmdlet on Line 3 passing them in to create a connection.  Running this now should return the command prompt with no errors, which means it connected successfully.  Note, with these online cmdlets no errors means success.  Red error text will show in the shell if there is an error, which means one of the variables are not correct so just check them again for accuracy.
--Pull Tenant information
With our connection to our Admin Tenant locked in, the first query cmdlet to call is Get-SPOTenant on line 5 which will output a list of all the Tenant property's that have been set including quota's and sharing status.
--Pull all Site Collection's
The next cmdlet we'll test is the Get-SPOSite one on Line 7 that pulls all our Site Collection's the way I have it setup with the current piping, or you can tell it just one that you want to look at by adding in the target URL before the -Detailed property.  Looking at the results returned, we can see last Modified Date, individual quotas, it's Title, and of course the sharing status.
--Pull all users for a Site Collection
Now that we have our list of Site Collection URL's, we can see all our users within that collection.  On Line 9 we create a variable for reuse later with our target URL, then on Line 10 we call Get-SPOUser passing in that Site Collection URL variable.  From the output below we can see that we were returned  a list of all the users in our Site Collection along with their Login Names and any SharePoint Security Groups they're attached to.  This can be very useful for checking who is in which SharePoint Security Groups for you site.
--Pull all Security Groups for a Site Collection
And finally, we can query a specific SharePoint Security Group to see all the individual users if we need to pull out all that have been created.  On Line 12 we call Get-SPOSiteGroup again passing in the Site Collection URL variable.  This final output shows us all the Groups, including Owners logins for managing and the users inside of them.  Another great way to check on your security settings.
Using these SharePoint Online cmdlets is a quick and repeatable way to query your Tenant to ensure security and settings are correct.  There are of course Add-xxx, Set-xxx, and Remove-xxx cmdlets to complement the Get-xxx ones I detailed above for making changes to your SharePoint Online instance during or after migration.
References:

by Craig Pilkenton via Everyone's Blog Posts - SharePoint Community

Thursday, July 2, 2015

Using Managed Metadata for JavaScript typeahead textboxes

One of the great benefits of SharePoint is the way it has centralized repositories of information that we can reuse over and over to support our users.  The Managed Metadata Service is one of the most powerful in that it allows for one central location to store and manage keywords or sets of terms, but can be delegated down to any users to keep it current for the business.  This, along with its support of nested terms and Alternate Labels, makes it perfect to help users categorize and find their content.
Using this easy service of Keywords, we'll query the service for different Term Sets and make them available as a typeahead feature in any of our textboxes.
Firstly, what is the Managed Metadata service and why do we want to use it for this purpose?  Managed Metadata, known also as "the Term Store", is a hierarchical collection of centrally managed terms that an organization can define, and then use as attributes for items or 'information about information'.  Once defined, these terms can be added as columns to SharePoint Lists and Library's for tagging with values that can be reused over and over, but updated from one place so the changes propagate seamlessly.
So now that we understand the Term Store's capabilities, we can realize why an organization would want to use that service as they're already tagging their documents with these values.  This is especially powerful when using the typeahead boxes to drive better Search Results for your users.
Ok, how do we hook all this up now that we know why to use it?  There's several major sections we'll walk through in the code below that will detail out the necessary steps.  One thing to not is that we'll be using JSOM to work with the Managed Metadata service as Microsoft has still not released a REST API for working with it like they have for all the other core services.
--Setup HTML & include JavaScript Library
The first thing the code starts with in lines 1-3 is to load any necessary CSS and the jquery.typeahead.js file we'll need to do the work.  There are several other libraries of this type, but I found this Twitter version from GitHub the easiest to work with.
Also, you'll need to force the loading of sp.taxonomy.js for accessing the Term Store.  I made this reference in the Master Page as these typeahead's were going to be available on almost every page, but normally you'd want to load the library only when you'll need it (see References article below).
On Lines 6-48 is the build-out of the HTML to show using a Content Editor Web Part (CEWP) that are a set of duplicate element sections, here to target different Term Sets for typeahead.  The layout of the elements and their class names are specific to how the jquery.typeahead.js library needs them to be formatted, with the exception of the <input /> tags highlighted.  I updated the id="" and the name="" values to be specific to the Term Set I wanted to make available as their typeahead.
--Begin script processing
In the next section, lines 49-62, we start actual processing by instantiating variables to be accessible to all functions including a namespace-like the one activating .noConflict(), which releases jQuery's hold on the "$" shortcut.  This means that anyplace that we would normally use the dollar sign to reference jQuery, we put the variable's name in its place.  There are some JavaScript Library's, like the Twitter typeahead, that use the "$" and will throw errors.
The final few lines of code, the "(document).ready(function() {" section, tells the JavaScript to wait until the DOM is fully loaded before allowing any processing.  Once ready, we call the SharePoint 2013 specific command 'window.ExecuteOrDelayUntilScriptLoaded(getACConfigVals, "sp.js");' which is necessary when using CSOM/JSOM to ensure the functions we'll need have been loaded.  The first parameter we put in is which of our functions to call for starting the real work once sp.js has been loaded.
--Load the Term Store name & Term Set ID keys
Now that SharePoint's JavaScript libraries have been loaded, we need to complete our variables for talking to the Managed Metadata service.  Starting with Line 63 through the Line 83, the 2 functions there query a List I setup behind the scenes called "Configuration Admin" where I needed to store several key-value pairs for many of these SPA's (Singe-Page Applications).  If you don't need this much overhead, just set the 2 variables 'termStoreName' (Line 57 - nice name of the Service in CA) & 'termSetId' (Line 58 - internal GUID). to get this to work after commenting out these functions.
--Contact the Managed Metadata service
With everything setup we can finally start our querying of the Term Store beginning on Line 85 where I call the function loadAutoCompleteVariables(), passing in the input element ID I want to attach to and the name of the child Term Set we want to target (your use may only have one).
From Line 91 - 146 the loadAutoCompleteVariables() function sets up several variables based of SP.Taxonomy.TaxonomySession type from the sp.taxonomy.js library we force-loaded earlier, also using the Term Store name & Term Set ID keys queries/set above.  Then on Line 98 the last variable fires the .getAllTerms() method which builds an object containing an enumerator.  Using that terms object we then tell our Context object to load those Terms asynchronously into memory, also including extra parameters to force Labels to come through (or else SharePoint hides them from us).
--Enumerate all the Terms, then enumerate their children Labels
Starting on Line 105, the code begins walking through each Term returned and gathers it's property's, including the Labels collection, and appends each one to a comma-separated variable of the Titles.  Then on Lines 114 - 125 the code enumerates the Labels collection of the Term gathering distincts, shoving them into an array, and finally on Lines 129 - 135 we loop through the cleaned array to add the Labels to the core Titles variable.
--Cast as an array and have typeahead.js bind array data to HTML
On Lines 138 & 139 we take our core Titles variable and split it into an array, then append that new object into a JSON array for assigning the typeahead data.
Lastly, on Line 142 we pass in our target Element and JSON array to the loadAutoComplete() function that runs on Lines 147 - 155.  This final function takes our target Element and data, then uses the typeahead library to bind them to each other.
Creating typeahead's for your users gives them the ability to tie into your organization's infrastructure without having to memorize exact words.  Using the Managed Metadata service for this, especially if you're using it for document tagging, increases findability in your organization and gives a better user experience.
References:

by Craig Pilkenton via Everyone's Blog Posts - SharePoint Community

Thursday, May 7, 2015

What we're hearing about SharePoint 2016 at Microsoft Ignite

Here at Ignite I've been attending all the SharePoint and Office 365 related sessions to learn what's coming and what's changing, where the tagline is "Mobile First, Cloud First". After a keynote where it barely received a mention (almost accidentally said it seemed) and a roadmap session that was mostly a history lesson, we learned that Office 365 would now be the driver for the platform and not the Enterprise. The roadmap session spoke of social, analytics, and infrastructure improvements that would be coming but nothing specific, not even at a 10,000 foot level.

The sessions have talked about the faster feature-release cycle of Office 365 and that it may increase SharePoint On-Premises Service Pack availability, but no details on what may be in them or their components. Hopefully we won't see the forced feature changes that Office 365 pushes, instead going with the Yammer or Newsfeed option we received in SharePoint 2013.

What does this bode for the On-Premises platform? It's unclear what this will actually mean, besides that the cloud's capabilities and/or limitations will drive changes for On-Premises implementations. Does this mean that with every Service Pack we have to worry about features just disappearing for our users, core JavaScript API's changing/breaking causing solution rework, or even Master Page updates without path-forward steps. All of which have happened with little-to-no warning in Office 365.

I think it remains to be seen whether this bodes well for the platform. Time will tell if this shift will be celebrated by our users, or make future SharePoint versions feel lesser than before.


by Craig Pilkenton via Everyone's Blog Posts - SharePoint Community