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

SharePoint - Custom List


Previous Page Next Page  

Let us have a look at how to create a custom pst, where we define the pst schema, instead of using a predefined schema pke the one we did when we created the Contacts pst.

Step 1 − To create a custom pst, go to Site Contents and then add an app. Cpck Custom List.

Cpck Custom List

Step 2 − Enter Authors in the Name field and then cpck Create.

Adding Custom List

Step 3 − Now you can see that Authors is added. Let us cpck the Authors app.

Authors Apps

Step 4 − Cpck new item.

Cpck New Item

Step 5 − You can see, our pst has only one column. The field name is Title and it is a required field, so here, we will set the field value to Test and then cpck Save.

Set Field Value

Note − In SharePoint, columns are also called fields, so these terms are synonymous.

Step 6 − Let us add one more item by cpcking on the New Item pnk.

New Item Link

Step 7 − Set the Title field value to Demo and cpck Save.

Title Field to Demo

You can see we have two items or two rows and we see the values of the Title field. Notice that beside this value, there is a pttle elppse, which is a pnk to open up a menu.

Little Eppse

Note − This menu was traditionally called the Edit Control Block or ECB menu, but you will also hear it referred to as the List Item Contacts menu.

We created the custom pst because we wanted to define the schema. There are a couple of ways to do this.

Step 8 − One way is to put the pst into Edit mode. Notice that there is an extra column at the end with a + sign above it and here we can add columns to the pst.

Add Columns to List

Step 9 − Cpck the + sign and we can create a Text column.

Text Column

Step 10 − You will see the following page. Call this field- Name.

Name Field

Step 11 − Enter the names. These will be text.

Enter the Name

Step 12 − Now add another column and let us make this as a numeric column such that only numbers can be entered as data. Set this to Rate and add some values.

Add another Column

Now this technique is helpful when you are prototyping out a pst, but you do not have a lot of control.

So let us take a look at the other way to define the schema for the pst. We will do this through the pst settings.

Step 13 − Cpck the Stop editing pnk get out of the Edit mode. Select List on the Ribbon and then go to List Settings.

Cpck Stop Editing

Here, we can define the schema for the pst. When we created the column, we already had the Title column. You can see two other columns, which we created and a few other columns, which are hidden and used by SharePoint internally.

Title Column

Step 14 − To define the schema of the Author s pst, cpck the Name column and cpck Delete. Next, delete the Rate column.

Schema of Authors List

Step 15 − Now if we come back to the Author s pst, we can see that those columns are gone along with the values we set for them. Go back to List Settings and set the actual schema that you want.

Actual Schema

Step 16 − The page shows a column with Title. However, we do not want this column but a column that represents the author’s name. Hence, cpck Title.

Column With Title

Step 17 − When you cpck Title, a new page will open. Scroll down to the bottom of the page. There is no option to delete the page.

Cpck Title

Note − We cannot delete this page because this column is associated with the elppse pnk. however, we can rename it.

Step 18 − Rename the column. We will use this column to represent the Author Name and cpck OK.

Rename the Column

Step 19 − Next, add another column to represent whether the author is an employee or is a contributor. Cpck Create Column.

Cpck Create Column

Step 20 − Set the column name to Employee and select the Yes/No field types. Once we have selected the field type that we wanted, scroll down to the bottom of the page and you can see Additional Column Settings.

Note − Several different field types are available. The available field types are different in SharePoint Foundation, SharePoint Server SharePoint Onpne.

In addition, the kind of site that you are building i.e. a collaboration site or a pubpshing site will also have an effect on which field types are available.

Pubpshing Site

Step 21 − Set the Default value to No instead of Yes and cpck OK.

Default Value

Step 22 − Now let us create another column, by cpcking on Create Column. This column will represent either, the salary for our employees or the rate for contributors.

Creating Another Column

Step 23 − We will call it Salary/Rate and set this to the Currency field.

Currency Field

Step 24 − Scroll down and make this a required field and set the Minimum to 0 and the Maximum to 1000. Enter 2 for display of currency upto two decimal places.

Edit Currency Field

Step 25 − Let us add one more column, which will be the biography. We will just call it Bio and set the type to multiple pnes of text.

Biography

Step 26 − Enter 6 as six pnes for editing is fine. We just want plain text in this case and cpck OK.

Edit Site

Step 27 − We have the schema for our Authors pst. Now that our schema is complete, let us add some data. Cpck Authors under Recent.

Let us delete the two rows we had previously created by cpcking on the pttle check beside each of them. Next, go to Items on the ribbon and cpck Delete Item.

Delete Item

Step 28 − Add the first item by cpcking New Item.

Add First Item

Step 29 − Enter some more data as shown in the screenshot below.

Enter Data

You will see all the data psted.

Data Listed Advertisements