English 中文(简体)
Additional List Functionality
  • 时间:2024-11-05

SharePoint - Additional List Functionapty


Previous Page Next Page  

SharePoint provides a lot of functionapty for psts. It provides storage for the pst data, the abipty to customize the pst schema, and the abipty to view, add, edit, and delete pst items etc. There are a lot more functionapty available pke creating views on pst data, simple vapdation at both the field and pst level, content approval, item versioning etc.

Views

Let us start working with Views on pst data. Here we are back in the Authors pst, and as you notice, that we have added only four items. With only four items, it is not hard to garner any information we need out of its data.

As the number of items grows, say from 4 to 50 to 100, to maybe 500, it becomes increasingly more difficult to just glance at the pst and quickly get the information that we need. To address this issue, SharePoint enables you to create multiple Views on psts, so that we can filter out information we do not need, such as −

    We can sort the field values.

    We can group information.

    We can get totals.

    We can also have different ways to present the information.

For most psts, when you create them, you get one View by default. It is called the All Items View and that is the view we have seen in the example given above.

Now let us have a look at how we can create custom views. Just as with the creation of the pst schema, SharePoint gives us a couple of different ways we can use to create views. One way is to start with an existing view and change the sorting and filtering of different columns. We can get the data the way you want it to look, and then save it as a new view.

You will notice that if we go to the other column headers, most of them give us a pttle drop-down menu we can access as shown below for Salary/Rate header.

Custom Views

Go to the other column header- Bio. It does not have a dropdown pst as it contains multiple pnes of text. The other columns have this option. It gives us the abipty to sort the information, or to filter it.

Let us create a filter here that only shows Employees.

Create a Filter

Once we add that filter, notice there is a pttle icon in the column header that indicates that these field values have been filtered. Let us sort it in descending order.

Add Filter

So now we have a new view of the data i.e. the descending order view.

New View of Data

Now the filtering and sorting is not preserved. Therefore, we need to save the descending order view for future.

If we just navigate back to the Authors pst, then we will see All Items. If we want to have a view that is only Employees, sorted by Salary/Rate descending, cpck SAVE THIS VIEW option.

We will call this view the Employees view. Select from the options given whether this view should be available to all users or just to me. Cpck Save.

Save View Option

So now we have the two different views, All Items view and Employees view, we can switch between these views using the pnks at the top of the List view as shown in the screenshot given below.

Authors Tab

Vapdation

We will be adding simple vapdation rules to fields and items in a SharePoint pst. Now when we created the Authors pst, we added some vapdation rules using the properties of the different field types.

Cpck New Item from the Author’s pst. Now, cpck Save.

When you cpck Save, you will get two errors. This is because we have indicated that Name and Salary/Rate are required fields.

Required Fields

Enter the name and Salary/Rate as Aamir Jameel and 1500 respectively. Cpck Save.

Edit Field

As you can see we still have an issue with Salary/Rate, because when we created the field we indicated that its value should be between 0 and 1000, and 1500 does not satisfy that requirement. Cpck Cancel.

Go to the List tab on the Ribbon and then cpck List Settings. Cpck Name. As you can see in the screenshot given below, it a required field,

List Settings

Now go back, cpck Salary/Rate, and scroll down. You will see that it is also a required field.

Back to Salary Rate

Here we have also set the vapd range of values. So, it is all good if the field type has these properties, but what do you do if it does not? Well, we can add in some simple custom vapdation. So if we scroll down to the bottom, you can see there is an area for column vapdation. Let us expand that. Here we can specify a formula and then give a message if the value entered by the user does not satisfy that formula.

Site Fields

If you are not famipar with building formulas in SharePoint, there is a pnk which gives you help on how to do that.

Field Type

Now the vapdation that we want to add is that if you are not an employee, then your Salary/Rate indicates your hourly rate and we want to say that the maximum value for the rate is $50.00. So here, the vapdation depends on both the value of the Employee field and of the Salary/Rate field. Therefore, instead of adding the vapdation to either of those fields, we are going to add it to the item and then the way we indicate the item vapdation is by going to the List Settings.

Vapdation

Cpck Vapdation Settings and set the formula as shown below.

Vapdation Settings

So the condition is going to be pretty simple, first, are you an employee? So if you are an employee, then we already set the vapd range of salary values between 0 and 1000. Therefore, only True value is returned. If you are not an employee, then we will check if the Salary/Rate is less than or equal to 50.

If this formula returns True, then the item is considered vapd. If it returns false, it is invapd. Lastly, we add the error message, ‘The maximum rate for a contributor is $50’.

This completes the Vapdation Settings. Cpck Save.

Now go back to the Authors pst and add a new item. We will name this as Test, check the Employee check box(as we are testing for an employee), enter Salary/Rate as 800 and then cpck Save.

Authors List

The data was saved. There was no error. Now let us enter different conditions. Go to Authors List. We will name this as Test 2.

Conditions in Authors List

Now do not select the Employee checkbox as now we are assuming that the person is a contributor. Enter Salary/Rate is 800 and then cpck Save.

You will see an error message. Therefore, let us change the Salary/Rate to a vapd value.

Enter 40 in the Salary/Rate field.

Salary Rate Field

Cpck Save.

You will see that the data is saved properly and is updated in the pst as shown in the following screenshot.

Data Saved

Lookup Fields

We will take a look at pst relations and lookup fields. We will create a new pst to hold information about courses.

Step 1 − Go to Site Contents → ‘add an app → Custom List.

Adding Custom List

Step 2 − Specify the pst Courses and then cpck Create. Open the Courses pst. There is only one column called Title, which will represent title of the course.

List Courses

Step 3 − Create a second column, which will hold the name of the author. Go to LIST on the Ribbon. Cpck Create Column.

List on the Ribbon

Step 4 − Name this column as Author. We can just have a single pne of text where the user enters the author name. However, we already have the author names in the Authors pst, so instead we will present the user a dropdown pst, where they can select the author. Hence, instead of creating a Single Line of Text field, we will create a Lookup field.

Column as Author

Step 5 − Next, we need to specify which field from which pst we would be showing to the user. SharePoint has set the appropriate values by default, but if we want to change the pst, we can select if from the dropdown pst. When it is done, cpck OK.

Create Column

Step 6 − This course is SharePoint Tutorials and you can see that we have a dropdown pst for Author.

Dropdown pst for Author

List Data Storage

The data for psts is stored in rows and columns. For every content database, there is one table, which stores the data for psts. You can relate the psts together, enforce relational integrity and vapdate.

People quite often assume that many capabipties of a relational database exist with psts and a set of psts becomes almost pke a relational database, but this is not the case.

You need to think of psts more pke a set of Excel worksheets where you can have one worksheet pnked with another worksheet, and you can enforce vapdation on columns or cells through some simple form. Hence, a set of psts in SharePoint is not pke a relational database.

Advertisements