Identifying List Columns In Sharepoint Page Source Code
What Are SharePoint List Columns?
SharePoint list columns are the building blocks that make up SharePoint lists and libraries. They define the type of data stored in each row of a SharePoint list or library. Some common examples include:
- Text columns – Store text or numeric data like names, descriptions, and numbers.
- Date columns – Store dates and times.
- Lookup columns – Display data from another SharePoint list.
- Calculated columns – Display values calculated from other columns.
Columns give structure and context to SharePoint list data. They allow users to input, sort, filter, and view specific pieces of information in a list. Custom columns can also be created to capture specialized data types needed for business applications.
Purpose of List Columns
The main purposes of list columns in SharePoint include:
- Defining the types of data stored in a list or library
- Adding structure and context to list data
- Enabling sorting, filtering, and viewing of specific data points
- Capturing specialized information with custom columns
Common Standard and Custom Column Types
Some of the most frequently used list column types in SharePoint include:
- Single line of text – For capturing short text entries
- Multiple lines of text – For longer text strings
- Choice (drop-down menu) – For pre-defined selections
- Number – For numeric data
- Currency – For monetary values
- Date and Time – For dates with optional time
- Lookup – Pulls data from other lists
- Hyperlink or Picture – Links to another resource
Custom columns are also commonly added for specialized needs, such as:
- Calculated – Values computed from other columns
- Person or Group – To add user/group selectors
- Managed Metadata – For adding site-defined taxonomy
- External Data – Integrating external sources
Finding List Columns in Page Source Code
To troubleshoot issues with SharePoint list columns, it is sometimes necessary to analyze the page source code and inspect the underlying column definitions. Here are the key steps for finding list columns in SharePoint page source:
Viewing Page Source Code in SharePoint
To view the source code of a SharePoint page:
- Navigate to the target SharePoint page in the browser
- Right click and select “View Page Source” or similar
- The page source code will open in your browser or a text editor
Locating List Web Part References
When a list view web part is added to a page, it incorporates the associated SharePoint list data into the page source code.
To find list references, look for web part XML elements like:
<webpart> <data> <properties> ... <property name="ListUrl" value="Lists/MyList"/> </properties> <data> </webpart>
This points to the source list location relative to the site. The list can then be mapped to its unique ID.
Matching List GUIDs to Library or List IDs
The unique identifier for the list itself will be referenced in multiple locations, like:
<parameter name="ListID" value="{LIST-GUID}" />
This GUID can be matched to the actual Library Name or List Name via the site content as follows:
Site Content > Lists > {Library Name} > List Settings > List ID
Identifying Field References and Column Names
Once the correct list is isolated, individual <FieldRef> elements referencing list columns will appear:
<viewfields> <FieldRef Name="Column1"/> <FieldRef Name="Column2"/> </viewfields>
The field name attribute corresponds directly to the column names from the source list.
Example List Column Source Code Fragments
Here are some examples of SharePoint column references within page source code:
Text Column Source Code Example
<property name="TextField" type="Text"> <FieldRef Name="Title"/> </property>
This renders the “Title” text column from the attached list.
Lookup Column Source Code Example
<property name="LookupField" type="Lookup" List="{LIST-GUID}" ShowField="Title"/>
This defines a lookup column pointing to the Title field of the list with the referenced GUID.
Calculated Column Source Code Example
<property name="CalcField" type="Calculated" ResultType="Number" > <Formula>=[Column1]+7</Formula> </property>
This calculated column generates a number value by adding 7 to Column1.
Using Source Code to Troubleshoot List Columns
Analyzing the list column rendered in page source code can help troubleshoot display issues, validations, and integrations with list data.
Debugging Column Formatting Issues
If a column shows incorrectly, check the <property> attributes like “type” and validate proper mapping to the list <FieldRef> name.
Verifying Column Mappings
Tracing list column references in page source ensures accuracy and helps debug column mapping issues.
Checking Column Configurations
Column display settings like order, widths, and visibility are also defined in page source. Inspecting these can uncover configuration issues.
In summary, SharePoint list columns provide structure and context for list data. When list information renders incorrectly, analyzing the list columns and field mappings in the page source code allows troubleshooting of underlying issues.