Articles about European Sharepoint Hosting Service
Posts tagged free SharePoint 2013 Hosting

SharePoint 2013 Hosting – HostForLIFE :: Customize Modern SharePoint List Forms using JSON
Mar 16th
We usually use SPFx or Power Apps to customize the forms in SharePoint online. This article will show how you can customize an out-of-box SharePoint list form using JSON. You don’t need to customize the form using SPFx or Power Apps. Some simple JSON can be used to customize the header, footer, and body of the SharePoint list form. You can create different sections inside the form body and apply some validations to show and hide form fields based on the value of other form fields. The advantage of these JSON customized forms is that they are responsive by default. You don’t have to do any work to make these forms responsive. So, you can use the same form in desktop and mobile.
Create a custom list
Create a custom list using the template ‘Work progress tracker’. I have used this template for my example. You can use any other template or create your own custom list based on the requirement.
When you click on the ‘New’ button of the list, this is out of the box new/ edit form for the list. There is no customization. All fields are visible, as shown in below image.
For our example, we will create a new column, ‘Manager’ for the manager of the assigned user. We will show this field only if a work item is ‘Critical’ in priority.
Show/Hide form field based on conditions
We have a requirement to show the Manager field in the form only when Priority is Critical. To apply a conditional check to show/hide the Manager field, click the New list button to open the list form. Click on Edit columns from top right options available in New form.
Select the Edit conditional formula for the Manager field in the context menu of the field.
You will see below a blank screen to add your formula for the field.
Formulas are equations that perform conditional checks on column values in a list or library. A formula starts with an equal sign (=) followed by the if the function that returns either a true or a false result.
For example, the following formula checks if the value for the Priority column is Critical:
=if([$Priority] == ‘Critical’, ‘true’, ‘false’)
Returning true results in showing the column on the form, while returning false hides the column.
Below is our custom formula based on our requirement to show/ hide the Manager field.
Once you add your formula for the field, your field will be greyed out. This indicates that this field has some custom formula applied to it.
We need to save these changes to apply this formula to the field. Click on the Save button to save the changes.
Reorder fields on the form
We can reorder columns fields of the form. Here we will shift Manager near the Assigned to field. Whatever field you want to move, drag and drop the field to your desired location. To save the changes, click on the Save button.
Test the changes
Now you have reordered the form fields and applied conditions to show/ hide the Manager field based on the selected Priority. Let’s test this by creating a new item in the list and selecting different priorities.
As you can see in the image above, the Manager field is visible when Priority is Critical.
When you change Priority from Critical to anything else, the Manager field is not visible. In the above image, we have selected Priority as High. So, the Manager field is not visible.
Add sections to form body
Now we want to arrange form fields in different sections like Work item details, Status details, and Assignment details. We can do this with the help of JSON without doing any customizations.
To add sections to the SharePoint list form, click the New button to open the form and select the Configure layout option from the options in the top right corner, as shown in the image below.
You will see options like Header, Body, and Footer in the Format window. You need to select Body.
You must add your JSON in the Formatting code field in this window.
Copy the example from the link and modify it according to your requirements:
For our example, JSON will be like this. Here we are adding 3 sections to the form: work item details, Status details, and Assignment details. We have specified fields also inside each of these sections. You need to specify the field display name for each field inside the section to regroup this fields inside sections.
Click the Save button to save these changes and regroup fields of the form in different sections. After saving these changes, you will see the changes when you click on the New button to open a new form.
As you can see in the image, all three sections are separated with horizontal line and have section headers. If you see JSON, we have one empty section in the last. This section holds all those fields not included in any of the above sections. Here blank section has the Attachments field.
Now if you edit form columns from the top right option available in New form, you can see all the fields grouped in different sections. You can also reorder or move these fields from this screen.
Customize Form Header using JSON
In the New form Configure layout, select Header in the Format window as shown in the below image.
You can copy the code provided in this link and change it as required. You can change text and icon etc., which is visible in the header of the form.
For icons, you can use any Fluent UI Icons from this link: https://developer.microsoft.com/en-us/fluentui#/styles/web/icons
For my example, I select the WorkiIem icon, as shown in the image below.
Final JSON code for my example:
After adding JSON, when you try to edit any item, the header will be visible as in the below image. This has the Icon we changed for WorkItem and has our custom text with the value of the Work item field (which is the Title field internally). We have to use the internal name of fields in JSON.
Customize Form Footer using JSON
In the New form Configure layout, select Footer in the Format window as shown in the below image.
You can copy the code provided in this link and change it as required.
JSON for the footer:
You can see the footer shown in the below image.

SharePoint 2013 Hosting – HostForLIFE :: Use Of Text Web Part In SharePoint Online
Mar 10th
In this article, we will discuss the use of Text Web part in SharePoint Online. This web part allows adding text content, images, pictures, table, and hyperlinks to the page, along with various formatting options.
Adding Text Web part in SharePoint Online Page
1. For inserting the Text Web part in the Site Page, click on Edit on the top right of the page to put the page in edit mode. Click on the + circled icon and select the Text web part. Click on Text and insert the web part.
2. After inserting the Text web part, the formatting toolbar along with the Text box will be displayed as under:
The formatting toolbar contains options such as Move Web part, Duplicate Web part, Delete Web part, Font Style, Font Size, Font Color, Highlight color, Bold, Italic, Underline, Right, Center, Left, Justify Alignment, Bulleted List, Numbered List, Increase Indent, Decrease Indent, Insert Table, Insert Image, Strikethrough, Hyperlink, Remove Link, Superscript, Subscript and More Styles.
3. Enter the desired text and format it using the formatting toolbar. To view more formatting options, click on the ellipses (…) on the right side of the toolbar. It will open the Text and Table Formatting panel on the right side of the screen.
4. The options in Text and Table formatting are similar to the Formatting toolbar options as mentioned above.
5. The font style and font size available are as follows:
6. Insert Image in Text Web part
- Click on Insert Image in the formatting toolbar. A dialogue box with various options to insert images such as Recent, Stock Images, Web search, OneDrive, Site, Upload, and From a Link will appear. Select the relevant option and insert the image.
- Once the image is inserted, it can be formatted using various options such as:
- Change Image: On click of Change Image option, the properties panel on the right side of the screen will be displayed providing us an option to change the inserted image or insert a link on the image or use the alternative text to describe the image.
- Alignment – Inserted Image can be aligned right, left, or center.
7. Insert Table in Text Web part
- Click on the Insert Table icon in the formatting toolbar or click on the Insert Table option in the Text and Table formatting panel to insert a table in the Text Web part:
- Table with 3 rows and 3 columns will be inserted in the Text Web part.
- The inserted table can be formatted using various available options such as Table Styles, Insert and Delete (To insert or delete rows, columns or entire table) and Table Alignment (Left, Center, and Right)
This is how we can use the Text Web part in SharePoint Online.

SharePoint 2013 Hosting – HostForLIFE :: Use Of Image Web Part In SharePoint Online
Mar 2nd
This blog describes the use of the Image Web part in SharePoint Online. It allows us to insert an Image on the page from our device or the web.
Adding Image Web part in SharePoint Online Page
To insert the Image Web part in the Site Page, select Edit on the top right of the page and put the page in edit mode. Click on the + circled icon and select the Image web part. Click on the Image and insert the web part.
After inserting the web part, the following default options for inserting the image will be displayed:
Select the relevant option and insert the image.
Once the image is inserted into the page following editing options will be available,
- Resize
- Crop with a free ratio
- Aspect Ratios
- Alignment
- Save
Caption can also be inserted for the image.
Click on the Edit Web part button on the top which will open the property panel on the right of the page displaying the following options:
- Change – Option to change already inserted image.
- Link – Adds a link to the image. On click of the image, it navigates to the link.
- Add Text over the image – Adds Text over the image similar to the caption. It appears on top of the image.
- Alternative Text.
This is how we can use the Image Web part in SharePoint Online.

SharePoint 2013 Hosting – HostForLIFE :: Getting Site Users Report Using PnP PowerShell
Feb 23rd
Recently, I have been tasked with getting the site user’s report in SharePoint sites in our organization Tenant. There are tools and other ways to get it. Here I have used PnP PowerShell version and the concept of PS Custom Object to achieve this task. In this article, we will see how to get the Site Users report using PnP PowerShell and PS Custom Object.
What is PS Custom Object?
This is a new property introduced in PowerShell 3.0 version and above, which helps in creating structured data, and with this data it makes it easier to
- Query the data
- Import and export the data
- Storing the data while working in a session
The details about PSCustomObject is nicely explained by Kevin in his blog and I would highly recommend checking it.
Pre-Requisites
Before proceeding you need to have the following configurations.
- Access to your organization tenant as SharePoint Admin or Global Admin or access to the sites as Site Collection admin where you want to get the site user’s report
- PnP PowerShell module installed. Please investigate the references section on how to install the PowerShell module.
Steps
Please follow the below steps to get the site user’s report.
Step 1
Connect to the SharePoint site
Step 2
Get the Permission Groups in the SharePoint site.
Step 3
For each user in Group get the required information and write to object. Here I am only getting Email, PrincipalType, Title, LoginName
If you are interested in getting additional properties you can also add them. By default, it gets the following properties, which can be found by querying a member with select * parameter.
Step 4
Export the object data into CSV.
Validation
Below is the input format of the CSV file.
Below is the output CSV after the script run completes.
Below is the complete script

SharePoint 2013 Hosting – HostForLIFE :: Create Lookup Field In Existing SharePoint List Using REST API Schema XML
Feb 10th
In this article, we will learn how to create a lookup field in an existing SharePoint list using REST API and schema XML. The REST API enables us to communicate with SharePoint using standard HTTP methods, such as GET, POST, PUT, and DELETE. The API provides access to various SharePoint entities including lists, libraries, and sites, allowing us to retrieve data, create and update lists, fields, items, upload files and manage user permissions.
Prerequisites
- Access to a SharePoint site with permissions to create lists and fields
Below are the steps,
Step 1. Create a lookup list
The first step is to create the list that you want to be the source of the lookup field. I will use the “Department” list with the “Title” column as a source for creating the lookup field in this demo.
Step 2. Create a new list
Create a new list and use it to create a multiselect lookup field by using the lookup list created in the previous step as its source.
Step 3. Create REST API request body
For creating the multiselect lookup field using the REST API, we need to define the request body for the API call. This body will contain the schema XML for the field, which must include the following properties:
- FieldType: Specifies the type of the field. For multiselect lookup fields, the value should be “LookupMulti”.
- Name: The internal name of the field.
- DisplayName: The name of the field as it will be displayed in the list.
- Required: Specifies whether the field is required or not.
- List: The ID of the lookup list.
- Mult: Specifies that the field is a multiselect field.
- ShowField: The name of the source field from the lookup list.
Step 4. Make the REST API Call
With the request body defined, you are now ready to make the REST API call. You can use any REST client to make the call, such as Postman. The REST API call should be made to the following URL:
The request should be a POST request and the request body should contain the schema XML defined in the previous step.
Output
After making the REST API call, you can verify that the multiselect lookup field was created by going to the destination list’s settings page and checking the list of fields.
List view

SharePoint 2013 Hosting – HostForLIFE :: Import Excel Data To SharePoint Online Using PowerShell
Feb 3rd
In this article, we will go through the steps required to import the Excel file data to SharePoint online list using PnP PowerShell. There are a lot of ways to import the data, but for this article, we will stick to PowerShell way. Here the credit goes to person Danile Finke who developed the Import Excel PowerShell module and made it available in PowerShell Gallery. Kudos to him.
Step 1
Open the PowerShell with Admin Privileges. Check if the PowerShell module ‘ImportExcel’ is installed. You can check the installed modules from PowerShell by running Get-Module in the PowerShell ISE or PowerShell Command window.
Get-Module
As you observed, in my case the ImportExcel module is installed.
Step 2
Check the availability of the module in PowerShell Gallery. You can do so by entering the below command.
Find-Module
The Find-Module queries the PowerShell Gallery and gets the information from it.
Step 3
Install the module “ImportExcel” by entering the below command in the PowerShell window.
Install-Module -Name ImportExcel -Scope AllUsers
Note: You may be prompted if you trust the repository. Select ‘Yes’.
Step 4
After installing you may have to import-module.
If you are not able to find the module try the import-module command.
Import-Module -Name ImportExcel
Step 6
Now check the Excel Columns by importing the excel data.
$data = Import-Excel -Path “C:\Temp\TestRecords.xlsx”
Here the columns marked in the screenshot above, are present in excel. Create a PS Custom Object accordingly. You can refer to the script section on how to do this.
Step 6
Check if the PnP PowerShell module is installed. If not check the article in the references, on how to install the PnP PowerShell module. If installed, import the module.
Import-Module -Name PnP.PowerShell
Step 7
Declare the following variables with the Site URL and the List Name where the excel data needs to be imported.
$SiteUrl = “https://contoso.sharepoint.com/sites/ContosoDev”
$ListName = “MyTestList”
Step 8
Initiate a connection to SharePoint online using the parameter -interactive
Connect-PnPOnline -url $SiteUrl -interactive
Note – Please note that the account running the script should have Site Collection Administrator rights.
Step 9
Read the excel data using the import-excel command and store it in a variable.
$data = Import-Excel -Path “C:\Temp\TestRecords.xlsx”
Step 10
Read each excel row data, and for each row record, update the SharePoint list using the Add-PnPListItem command.
Step 11
Validate the data in the SharePoint online list.
Complete Script
Conclusion
Thus, in this article, we have seen how to import the excel data to SharePoint online list using PnP PowerShell Module.