SharePoint Subscription Edition · Farm solution

Deployment Manual

Install or update Sample Form on a SharePoint Subscription Edition farm. For the farm administrator.

What this product is

Sample Form is a no-code form designer for SharePoint Subscription Edition (on-premises). A farm administrator deploys one solution package. Site owners then add the Sample Form web part to a page, design the form, and save submissions to a SharePoint list.

This package is a farm solution (WSP). It is not a SharePoint Online app and it is not deployed from the Microsoft 365 app catalog.
ItemValue
Solution packageSampleForm.wsp
Deploy scriptDeploy-SampleForm.ps1
FeatureFeature1, site-collection scope
Feature IDB7C8D9E0-F1A2-4B3C-8D9E-0F1A2B3C4D5E
Web part fileSampleForm_Procform.webpart
GalleryGroup: Microsoft Forms · Title: Sample Form

1Before you start

Ensure you have the following before proceeding.

  1. 1SharePoint Subscription Edition farm (on-premises).
  2. 2An account in the Farm Administrators group, run on a server that has the SharePoint binaries.
  3. 3SharePoint Management Shell (the Subscription Edition shell). Run it as Administrator.
  4. 4The web application URL and the site collection URL where the form will be used.
  5. 5The files from this download: SampleForm.wsp and Deploy-SampleForm.ps1.
Banner images uploaded from the designer are stored in the site's Site Assets library, folder SampleFormBanners. The library is created by SharePoint on a normal team site. The person who uploads a banner needs permission to add files there.
Replace every example URL in this manual with your own web application and site collection. Example used below: https://sharepoint.contoso.com.

2Copy the files to the server

On a SharePoint server, create a folder and copy both files into it.

C:\Deploy\SampleForm\SampleForm.wsp
C:\Deploy\SampleForm\Deploy-SampleForm.ps1
Use the WSP from this product download. Do not rebuild unless you have the source project and SharePoint developer tools.

3Deploy (recommended)

Open SharePoint Management Shell as Administrator and run the deploy script.

  1. 1Loads the SharePoint PowerShell snap-in.
  2. 2First install: Add-SPSolution, then Install-SPSolution to the web application (GAC).
  3. 3Later updates: Update-SPSolution (GAC) using the same WSP name, SampleForm.wsp.
  4. 4Waits until the timer job finishes. You should see LastResult=DeploymentSucceeded.
  5. 5Activates Feature1 on the site collection if it is not already active.
  6. 6Sets the web part gallery entry to title Sample Form and group Microsoft Forms.
cd C:\Deploy\SampleForm

.\Deploy-SampleForm.ps1 `
  -WspPath "C:\Deploy\SampleForm\SampleForm.wsp" `
  -WebAppUrl "https://sharepoint.contoso.com" `
  -SiteUrl "https://sharepoint.contoso.com"
-WebAppUrl is the web application that should receive the solution. -SiteUrl is the site collection where the feature is activated and the web part is added to the gallery. If you omit -SiteUrl, the script uses -WebAppUrl.
Leave the shell open while it prints JobExists=True. Wait until it prints DONE and LastOperationResult : DeploymentSucceeded. A deploy can take several minutes. The script stops with an error if the job is still running after 15 minutes.

4Deploy by hand (optional)

Use this only if you are not running Deploy-SampleForm.ps1. Run each block in SharePoint Management Shell as Administrator. Wait for each solution job to finish before the next command.

# First-time install
Add-PSSnapin Microsoft.SharePoint.PowerShell
Add-SPSolution -LiteralPath "C:\Deploy\SampleForm\SampleForm.wsp"
Install-SPSolution -Identity "SampleForm.wsp" `
  -WebApplication "https://sharepoint.contoso.com" `
  -GACDeployment -Force

# Update an existing solution
Update-SPSolution -Identity "SampleForm.wsp" `
  -LiteralPath "C:\Deploy\SampleForm\SampleForm.wsp" `
  -GACDeployment -Force

# Activate the feature on the site collection
Enable-SPFeature -Identity "B7C8D9E0-F1A2-4B3C-8D9E-0F1A2B3C4D5E" `
  -Url "https://sharepoint.contoso.com"
After a manual install, add the page, then edit it and insert Sample Form. If the web part is missing from the gallery, run the deploy script once so it can register the gallery title and group.

5Restart IIS

After DeploymentSucceeded, restart IIS so every server loads the updated assembly. On each server that serves the web application:

iisreset
iisreset briefly interrupts SharePoint on that server. In a multi-server farm, restart the web-front-end servers in turn, or use your normal maintenance window.

6Confirm the install

Verify the solution deployed successfully.

  1. 1Run the PowerShell command above and confirm Deployed : True.
  2. 2Open the site collection. Edit a page, choose Insert, then Web Part. Under Microsoft Forms, Sample Form should be listed.
  3. 3Add the web part. While the page is in edit mode, choose the list, fields, theme, and validation, then Save form configuration.
  4. 4Save and check in the page, then stop editing. Hard-refresh the browser (Ctrl+F5) and submit a test item. The item should appear in the list you selected.
Get-SPSolution SampleForm.wsp | Format-List Name, Deployed, LastOperationResult, LastOperationEndTime
Expect Deployed : True and LastOperationResult : DeploymentSucceeded.

7Put the form on a page

Once the solution is deployed and the feature is active, add the web part to any page.

  1. 1Create or open a site page on the site collection where the feature is active.
  2. 2Edit the page → Insert → Web Part → Microsoft Forms → Sample Form.
  3. 3In the designer, set the title, theme, list, and fields. Select Save form configuration.
  4. 4Optional: choose Use this page as New item form so List → New opens this form. Restore default New form returns the list to the standard SharePoint form.
  5. 5Check in the page and stop editing.
End users fill in the form in browse mode. Submitted values are stored on the configured list. Repeating rows, when enabled, are stored on a child list linked by parent item ID.

8Update to a newer build

Copy the new SampleForm.wsp over the old file (or pass the new path). Run the same Deploy-SampleForm.ps1 command. The script detects the existing solution and runs Update-SPSolution. Then run iisreset and hard-refresh the browser.

Saved form configuration on pages is kept. You do not need to recreate the web part for a normal update.

9If something fails

Use this table to diagnose common issues.

What you seeWhat to do
Script says the WSP was not foundPass -WspPath with the full path to SampleForm.wsp. Confirm the file is on the server where you run the shell.
JobExists=True for a long timeWait. Then open Central Administration → Monitoring → Check job status, and look for the solution deployment job. Do not start a second update until the first job finishes.
Web part is missing from the pickerConfirm the feature is active on that site collection. Run the deploy script again so it refreshes the gallery entry. Use Ctrl+F5.
The page still shows the old formConfirm Get-SPSolution shows DeploymentSucceeded after the update. Run iisreset on the web servers, then Ctrl+F5.
Save says no fields are selectedChoose the list, load fields, tick the columns to show, then save the form configuration again.
Banner upload failsUse JPG, PNG, or GIF under 5 MB. The account needs permission to add files to Site Assets.
Access denied on Add-SPSolution or Install-SPSolutionUse a farm administrator, on a SharePoint server, in SharePoint Management Shell started as Administrator.

10Uninstall

Remove the web part from pages first. Then run the following in SharePoint Management Shell.

Disable-SPFeature -Identity "B7C8D9E0-F1A2-4B3C-8D9E-0F1A2B3C4D5E" `
  -Url "https://sharepoint.contoso.com" -Confirm:$false

Uninstall-SPSolution -Identity "SampleForm.wsp" `
  -WebApplication "https://sharepoint.contoso.com" -Confirm:$false

# Wait for the job to finish, then:
Remove-SPSolution -Identity "SampleForm.wsp" -Confirm:$false
Uninstalling the solution does not delete list items that were submitted through the form. Any page that still contains the web part will show an error until that web part is removed.

Sample Form · SharePoint Subscription Edition · Deployment Manual. Keep this file with SampleForm.wsp and Deploy-SampleForm.ps1.