How to call one function inside second in jQuery/JavaScript

Let’s consider you have a function named makeAddition() as follows:

makeAddition(a,b){
   var c = a+b;
   alert("Addition: "+ c);
}

Now if you have another function named makeSubtraction() as follows:

makeSubtraction(a,b){
   var d = a-b;
   alert ("Subtraction: "+ d);
}

You can call makeAddition function inside makeSubtraction function as follows:

makeSubtraction(a,b){
   var d = a-b;
   alert ("Subtraction: "+ d);
   makeAddition (4,5);
}

Now when you call makeSubtraction (10,5), it will first alert answer as 5 and then it will call makeAddition function and will alert answer as 9.

Add Geolocation column in SharePoint using PowerShell

Hello Friends, in this article we will learn how we can enable a Geo-location column on custom list in SharePoint online. We will use a PowerShell script to add Geo-location column in our list. Same script can be used for SharePoint 2010/2013.

Add Geolocation column in SharePoint using PowerShell

  1. Open Windows PowerShell ISE

    Windows PowerShell ISE
    Windows PowerShell ISE
  2. Write below PowerShell code and run the same. Make the necessary changes in the below code like: $WebUrl, $EmailAddress, $List.
    #Load SharePoint CSOM Assemblies
    Add-Type -Path "C:\Users\Desktop\Data\Old\Microsoft.SharePoint.Client.Runtime.dll"
    Add-Type -Path "C:\Users\Desktop\Data\Old\Microsoft.SharePoint.Client.dll"
    
    #Define SharePoint URL, login details
    $WebUrl = 'https://myclassbook.sharepoint.com/teams/TestSite/'
    $EmailAddress = "[email protected]"
    $Context = New-Object Microsoft.SharePoint.Client.ClientContext($WebUrl)
    $Credentials = Get-Credential -UserName $EmailAddress -Message "Please enter your Office 365 Password"
    $Context.Credentials = New-Object Microsoft.SharePoint.Client.SharePointOnlineCredentials($EmailAddress,$Credentials.Password)
    
    #Define list name where we need to add Geolocation column
    $List = $Context.Web.Lists.GetByTitle("Project Portals")
    $FieldXml = "<Field Type='Geolocation' DisplayName='Location'/>"
    $Option=[Microsoft.SharePoint.Client.AddFieldOptions]::AddFieldToDefaultView
    $List.Fields.AddFieldAsXml($fieldxml,$true,$option)
    $Context.Load($list)
    $Context.ExecuteQuery()
    $Context.Dispose()

    Screenshot of above code:

    Add geolocation column in sharepoint using powershell
    Add Geo-location column in SharePoint using PowerShell
  3. Once the script is successfully executed, you can see that the Geolocation columns with Display Name “Location” will be added in your list.

    Add Geolocation column in SharePoint using PowerShell
    Add Geolocation column in SharePoint using PowerShell

Downloads:
1) Microsoft.SharePoint.Client.Runtime.dll
2) Microsoft.SharePoint.Client.dll
3) PowerShell Script

I hope you liked this article. Please let us know in case you are having any questions in the comment section below. Like our facebook page and subscribe to our newsletter for future updates. have a great time 🙂

Export all users from SharePoint group in Excel

Hello friends, in this article we will see how we can export a list of all users present in a SharePoint group.

Export all users from SharePoint group in Excel

  1. Open Microsoft Excel and Click on From OData Data Feed as shown below:

    Click on
    Click on “From OData Data Feed”
  2. In ‘Data Connection Wizard’ Enter the REST URL as below:

    https://myclassbook.sharepoint.com/teams/TestSite/_api/Web/SiteGroups/getbyid(142)/UsersMake sure that you have entered the correct site URL and group ID. You can find the group ID by opening specific group URL: 

  3. Click on Next and you will ask to choose the required Data. In this case we will only get the option for Users. Check it and click on Next.
  4. You can then see that the data will be loading in your Excel:
  5. Once it retrieves all the users from SharePoint group, you can save the file 🙂

I hope you liked this article. Please let us know in case you are having any questions in the comment section below. Like our facebook page and subscribe to our newsletter for future updates. have a great time 🙂