How to call one function inside second in jQuery/JavaScript

Hello friends,

In this short article, we will see, how can we call one function inside second in JavaScript.

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

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

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

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

You can call makeAddition function inside makeSubtraction function as follows:

function 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.

You may also like:

I hope you liked this article. If you have any queries, please use below comments section for the same. Please like our facebook page and subscribe to our newsletter for future updates. Have a nice day! tada…

Add Geolocation column in SharePoint using PowerShell

Hello Friends, in this article we will learn  how to add Geolocation column in SharePoint. Using powershell, we can enable a Geo-location column on a custom list in SharePoint online. We will use a PowerShell script to add Geo-location column in our list. The 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 the 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

You may also like:

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 🙂