2

I'm working on this project where the we need to add a map to a list that shows the different offices, and what I've found after some research that SharePoint Online has a hidden column that can only be activated either via powershell or programmatically.

So I continued my research and found a few examples that seemed pretty decent but I've been sitting here for several days trying to work out how to add the geolocation column. I've tried with Windows Powershell, SharePoint Online Management Shell, adding JavaScript/HTML in script edit, tried with content editor as well.

The resources I've used was:

http://sarandoniparthi.blogspot.se/2014/11/use-geolocation-column-to-show-map-view.html

(Had more but couldn't add all the links)

This is the one I'm working with now: http://www.rapidcircle.com/nl/walkthrough-add-geolocation-column-to-your-list-in-office-365/

The error messages I get are this:

New-Object : Cannot find type [Microsoft.SharePoint.Client.ClientContext]: veri fy that the assembly containing this type is loaded. At line:23 char:12 + $Context = New-Object Microsoft.SharePoint.Client.ClientContext($WebU ... + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + CategoryInfo : InvalidType: (:) [New-Object], PSArgumentExcepti on + FullyQualifiedErrorId : TypeNotFound,Microsoft.PowerShell.Commands.NewOb jectCommand
New-Object : Cannot find type [Microsoft.SharePoint.Client.SharePointOnlineCred entials]: verify that the assembly containing this type is loaded. At line:25 char:24 + ... edentials = New-Object Microsoft.SharePoint.Client.SharePointOnlineCr ... + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + CategoryInfo : InvalidType: (:) [New-Object], PSArgumentExcepti on + FullyQualifiedErrorId : TypeNotFound,Microsoft.PowerShell.Commands.NewOb jectCommand You cannot call a method on a null-valued expression. At line:26 char:1 + $List = $Context.Web.Lists.GetByTitle(“$ListName”) + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + CategoryInfo : InvalidOperation: (:) [], RuntimeException + FullyQualifiedErrorId : InvokeMethodOnNull Unable to find type [Microsoft.SharePoint.Client.AddFieldOptions]. At line:28 char:1 + $Option=[Microsoft.SharePoint.Client.AddFieldOptions]::AddFieldToDefa ... + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + CategoryInfo : InvalidOperation: (Microsoft.Share...AddFieldOpt ions:TypeName) [], RuntimeException + FullyQualifiedErrorId : TypeNotFound You cannot call a method on a null-valued expression. At line:29 char:1 + $List.Fields.AddFieldAsXml($fieldxml,$true,$option) + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + CategoryInfo : InvalidOperation: (:) [], RuntimeException + FullyQualifiedErrorId : InvokeMethodOnNull You cannot call a method on a null-valued expression. At line:30 char:1 + $Context.Load($list) + ~~~~~~~~~~~~~~~~~~~~ + CategoryInfo : InvalidOperation: (:) [], RuntimeException + FullyQualifiedErrorId : InvokeMethodOnNull You cannot call a method on a null-valued expression. At line:31 char:1 + $Context.ExecuteQuery() + ~~~~~~~~~~~~~~~~~~~~~~~ + CategoryInfo : InvalidOperation: (:) [], RuntimeException + FullyQualifiedErrorId : InvokeMethodOnNull Cannot index into a null array. At line:33 char:1 + $web.AllProperties[“BING_MAPS_KEY”] = $BingMapsKey + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + CategoryInfo : InvalidOperation: (:) [], RuntimeException + FullyQualifiedErrorId : NullArray You cannot call a method on a null-valued expression. At line:34 char:1 + $web.Update() + ~~~~~~~~~~~~~ + CategoryInfo : InvalidOperation: (:) [], RuntimeException + FullyQualifiedErrorId : InvokeMethodOnNull You cannot call a method on a null-valued expression. At line:35 char:1 + $Context.ExecuteQuery() + ~~~~~~~~~~~~~~~~~~~~~~~ + CategoryInfo : InvalidOperation: (:) [], RuntimeException + FullyQualifiedErrorId : InvokeMethodOnNull You cannot call a method on a null-valued expression. At line:36 char:1 + $Context.Dispose() + ~~~~~~~~~~~~~~~~~~ + CategoryInfo : InvalidOperation: (:) [], RuntimeException + FullyQualifiedErrorId : InvokeMethodOnNull

I'm not quite sure what to do anymore?

Any help or guidance are appreciated!

  • Did you download SharePoint online management shell? Verify that Microsoft.SharePoint.Client.dll are present in your machine – Unnie Sep 16 '16 at 13:53
  • @Unnie I did download it and after a while it worked finally!! =) Thank you!! – Donna.M Sep 19 '16 at 8:52

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.