SpHUB Book a demo

SharePoint vehicle assignment web part

SPHub's vehicle assignment module is a SharePoint vehicle assignment web part that records which vehicle goes out with which driver, for what purpose and from when, in one SharePoint list inside your own Microsoft 365 tenant. A setup wizard creates that list, its thirteen fields and five pages; staff then book a vehicle through a two-step form, and the same record later takes the return date and the return mileage.

This page describes what the module's code does and, where it matters, what it does not do. It covers the assignment side of SharePoint vehicle management; the view names below are quoted as they appear in the product's English interface.

The list and fields the setup wizard creates

The setup wizard creates one SharePoint list for vehicle assignment, named SPHubVehicleAssignment, with thirteen custom fields.

Fields in the assignment list

type and rule
  • Form NumberText, required; the form fills it in
  • Vehicle PlateText, required, at most 8 characters
  • Leave DateDate and time, required; the day and hour the vehicle goes out
  • Leave MileageNumber, required, not below 0
  • Return DateDate and time; empty until the return is recorded
  • Return MileageNumber, not below 0
  • DepartmentMultiple lines of text, required
  • PurposeMultiple lines of text, required
  • DriverText, required; the driver's name
  • StatusChoice: Active, Returned
  • Driver UserPerson, optional; the driver as a SharePoint user
  • Approval StatusChoice: Pending, Approved, Rejected; new items start as Pending
  • Is ActiveYes or No, defaulting to Yes; the flag behind deletion, covered below

Every item also has SharePoint's own Title field, which the forms do not fill in. The column names and choice values are created in English. On an empty list the wizard adds one sample record, so the views are not blank on day one.

The New Vehicle Assignment and Update Vehicle Assignment forms

The New Vehicle Assignment form has two steps, Vehicle & Driver and Schedule & Purpose, and the Update Vehicle Assignment form uses the same two.

  • Step 1: Vehicle & Driver

    The first step shows a read-only Form Number, then asks for the Vehicle Plate, the Driver and the Department; all three are required. The form number is generated as VA-YYYYMMDD-XXXX: the letters VA, the date, and four random hexadecimal characters. The plate is saved without spaces and in capitals. The Driver is chosen with a people picker, and the Department is a dropdown fed by the SPHubDepartments list when that list has entries, or a text box when it does not.

  • Step 2: Schedule & Purpose

    The second step takes the Leave Date with hour and minute dropdowns, the Leave Mileage, the Purpose and an optional attachments picker set up for PDF, Word, Excel, JPEG and PNG files. Leave Date, Leave Mileage and Purpose are required. The leave date cannot be in the past, and the leave mileage must be above 0.

  • Double-booking check

    The forms refuse to save an assignment when the same vehicle is already out. The form looks for active assignments of the same plate, comparing plates without spaces and without regard to capitals, and shows "This plate already has an assignment for the selected date range. Change the dates or pick a different vehicle." Because the New form has no return date, it checks only the chosen leave time; an assignment with no return date counts as still out. The Update form checks the whole span from leave to return and ignores the record being edited.

  • Update is a return form

    Update Vehicle Assignment opens from the edit icon on a row and locks everything except the return side. Plate, Driver, Department, Leave Date and time, Leave Mileage and Purpose cannot be changed; Return Date and time, Return Mileage and the attachments can. Saving a return mileage above 0 sets Status to Returned, the return mileage must exceed the leave mileage, and the return date cannot precede the leave date.

  • Progress and safeguards

    A progress indicator rises as fields are filled in. Leaving with unsaved changes asks you to confirm, and after a save the New form offers Add another assignment or Return to list.

Views: all assignments, your own, and the recycle bin

Setup creates five pages for vehicle assignment, and three of them appear in the site menu, under a Vehicle Assignment entry in the General group of the product's English interface: All Vehicle Assignments, My Vehicle Assignments and New Vehicle Assignment.

Vehicle assignment pages

what each shows
  • All Vehicle AssignmentsEvery active assignment, 50 rows to a page, with search, column filters, sorting, a detail panel, delete for selected rows, CSV export, an Approval column and a Load more button after the first 100 rows
  • My Vehicle AssignmentsThe assignments you created, with a delete icon on each row; no Approval column and no CSV export
  • New Vehicle AssignmentThe two-step form above
  • Update Vehicle AssignmentNot in the menu; opened from the edit icon on a row
  • Vehicle Assignments Recycle BinNot in the menu; opened from the Recycle Bin button on All Vehicle Assignments

Both list views have three tabs: All Assignments, Active and Returned. The tabs split on return mileage, so an assignment is Returned once a return mileage above 0 is saved. A row with no return date reads Not Returned. On All Vehicle Assignments, a row whose return date has passed without a return mileage also gets an Overdue badge, and a Total Distance column, hidden until you add it under Choose columns, shows return mileage minus leave mileage in km. Visible columns are saved in the browser, so they follow the browser rather than the account.

Approval, email and deletion

Assignment records carry an approval status, can notify the fleet and HR addresses by email, and are deleted softly so that they can be restored.

  • Approval

    A new assignment starts as Pending. Members of a SharePoint group named SPHub Approvers see Approve and Reject icons on the rows of All Vehicle Assignments; everyone else sees none, and My Vehicle Assignments has no such column. The setup code does not create that group. The seeded email templates include none for approving or rejecting, so by default that action sends no email.

  • Email

    SPHub emails the Fleet address and the HR address saved in SPHub Settings, and the module's contact person, whichever exist, whenever an assignment is created or updated. It copies the person who saved. If none of the three is set, nothing is sent. Vehicle assignment is one of two modules that can send without a contact person; the other is annual leave. The seeded messages list the form number, plate, driver, department, leave date, return date and purpose, and the message goes through Microsoft Graph as the person who saved, so it lands in that person's Sent Items.

  • Soft delete and restore

    Deleting an assignment sets Is Active to No and leaves the item in the list. The Recycle Bin view lists those items and restores them. This is SPHub's own recycle bin, not SharePoint's, and neither view deletes an item for good. A deleted assignment no longer counts in the double-booking check.

  • What it does not do

    The module keeps no separate register of vehicles, and nothing in it records maintenance, fuel or insurance; the plate is typed in as text and the assignment list is the only list the module creates. It has no calendar view and no reminder emails, and the Overdue badge is a label on a row, not a notification.

Where the data lives and who can see it

Assignment data lives in the SPHubVehicleAssignment list on your own SharePoint site, an ordinary list you can open, export, back up and audit; where SPHub stores your data covers the whole product.

  • Your permissions apply

    SPHub adds no permission model of its own, so SharePoint's permissions on the list decide who can read and change assignments. The only SPHub-specific gate is the approver group described above.

  • Graph permissions

    Two of the three Graph permissions touch this module. Mail.Send sends the notification email, and People.Read powers the driver picker on the New form. Neither reads your employee directory.

  • Microsoft Teams

    The web part can be added as a Teams tab. In a Teams tab it always opens the All Vehicle Assignments view, not the other pages.

  • Settings page

    The Fleet and HR addresses are two rows, Vehicle Assignment — Fleet email and Vehicle Assignment — HR email, in the Configuration section of the SPHub Installer Settings page. The Vehicle Assignment Settings page sets the module's contact person and edits the choice values of the Status and Approval Status fields. The forms write the values Active and Returned by name, so renaming those two choices does not change what the forms write.

How you get it

Vehicle assignment ships inside SPHub, and every SPHub plan includes every web part.

  • Created by the setup wizard

    Setup creates the list on every install. Enable the vehicle assignment module when you run setup and the wizard also creates its pages; the install page has the steps.

  • One licence, every web part

    No plan ships fewer web parts. Pricing is per user and falls with headcount, and the pricing page lists the five bands.

  • The other modules

    Vehicle assignment is one of the 27 web parts; the web parts page names the rest.

Questions about SPHub vehicle assignment

The module's double-booking check, return handling, personal view and email are the four details answered below.

  • Can the same vehicle be assigned twice for the same time?

    Both forms refuse to save an assignment when an active assignment for the same plate is already out at the chosen leave time, and the comparison ignores spaces and capitals in the plate. The New form has no return date, so a booking that leaves before an existing one begins is not caught there; adding a return date on the Update form checks the whole span.

  • How is a vehicle marked as returned?

    A vehicle is marked as returned by saving a return mileage on the Update form: a mileage above 0 sets Status to Returned and moves the row to the Returned tab. Saving only a return date does not do that. The return date is what frees the plate, because an assignment with no return date counts as still out in the double-booking check, so save the date as well as the mileage.

  • Does My Vehicle Assignments show trips I drive?

    My Vehicle Assignments shows the assignments you created, not the ones that name you as the driver. Someone who books a vehicle for a colleague sees that record in their own view.

  • Does the driver get an email?

    The creation and update emails go to the Fleet address, the HR address and the contact person, with the person who saved in copy, not to the person named in Driver.

Other SPHub module pages

Vehicle assignment is not the only SPHub module with a page of its own: annual leave, expenses, travel requests, asset management, issue tracking, announcements and birthdays each have one.

Module pages

what it is
  • Annual leaveLeave requests with their own form and views
  • ExpensesExpense requests with their own form and views
  • Travel requestsTravel requests with their own form and views
  • Asset managementA SharePoint asset management template: a two-step form, Identity & Ownership then Purchase & Media, plus views for all assets, your own, and assets by type
  • Issue trackingLogging and following up problems, with their own forms and views, including tickets by status
  • AnnouncementsThe SharePoint announcements web part: company news posts on the home page
  • BirthdaysWho has a birthday this week, Monday to Sunday

See vehicle assignment in your own tenant

Run setup on a development site and watch the wizard create the list, then enable the module and watch it create its pages.