Poor Person’s Form Embedding in SharePoint Online Pages
In SharePoint – because it’s primarily a collaboration platform – we often struggle with the difference between security and obscurity.
Some content absolutely must be secured, meaning only certain people can see or edit it. In these cases, we set the permissions such that people simply can’t see or even be aware of the content.
Other content should just be kept out of the way by not showing links to it or including it in pages, and this can sometimes be referred to as obscurity. Audience targeting is a form of content management by obscurity: if the content isn’t of use to me, I may not see it, but that doesn’t mean I can’t get to it.
A very common business requirement is to allow people to provide some basic information, like a suggestion for a continuous improvement, their shirt or hat size for a company giveaway, or nominating someone for an award. We can configure the list which contain this information to only show the current user’s items in views, but that’s not necessarily security. If you need them, these settings are in List settings / Advanced settings / Item-level Permissions.
But that’s not the main point of this post. Sometimes the forms are simple and the process is not consequential enough to deserve a Power App or more complex form development. We just want to make the plain old list form available for people to use easily and shield them from the complexity of the underlying list itself. I see solutions all the time where the user is sent to a list view with tacit belief they will know to click the +New
button to create a new item in the list. In many workforces, even that is too complicated.
Sometimes Occam’s Razor applies: the simplest solution is the best one.
This is a trick I’ve used many times to make life easier for users and also keep them from plumbing around in the underlying list, even though they may be able to do so due to the permission settings being pretty open.
Some advice, though…
Don’t stick a form like this on the home page of an Intranet site unless you want everyone to see that form as the primary focus for the entire site. I would argue this is rarely the case. In my example, the Suggestion Box is part of the Continuous Improvement site. That effort has to have more to it than just the form.
Here’s the trick. I’m sure I’m not the first person to come up with it, and Emily (@eemancini) probably taught it to me in the first place!
- Create a new page in the site and add some explanatory text and imagery. Let your users know what you’re asking them to do and why it’s useful. A “naked” form doesn’t give them any context.
- Add an Embed Web Part to the page with a URL something like this:
https://sympmarc.sharepoint.com/sites/SuggestionBox/Lists/SuggestionBox/NewForm.aspx?Source=https://sympmarc.sharepoint.com/sites/SuggestionBox/Lists/SuggestionBox/NewForm.aspx
I’ll break that down below. - Add a navigation element to the home page of your site to take people to this page.
That ugly URL has the following parts:
https://sympmarc.sharepoint.com/sites/SuggestionBox/Lists/SuggestionBox/NewForm.aspx
– The list’s new item form you want to load in the page. All lists have forms pages, and have since SharePoint 2007:https://sympmarc.sharepoint.com
– Your SharePoint subdomain. This is my personal tenant./sites/SuggestionBox/
– The site where the list lives.Lists/SuggestionBox/
– The list itself. All SharePoint lists live under the/Lists
part of the URL path. (Document Libraries don’t.)NewForm.aspx
– This is the form you get when you click the+New
button on the list pages.
?Source=https://sympmarc.sharepoint.com/sites/SuggestionBox/Lists/SuggestionBox/NewForm.aspx
– Values after the?
are what’s called the query string. Manipulating what’s hdre has been a nice little arrow in the quiver for years. They are name/value pairs, so here we have:Source
– This is a special parameter name when it comes to SharePoint lists. It basically says “when you’re done here, redirect to the following URL”)https://sympmarc.sharepoint.com/sites/SuggestionBox/Lists/SuggestionBox/NewForm.aspx
– Yup, that’s the same link we’re loading above.
Your page will look something like this:
As you can see, the form is embedded directly in the page. In actuality, it’s housed inside something called an iframe
. You may have heard developers disparaging iframes
in the past, but in this case, it works just the way we want it to.
When the user fills out the form and clicks Save
, guess where they end up? Right in the same place! So they can submit one or more items – in this case suggestions – without ever knowing there’s a SharePoint list under the covers.
Have you used a trick like this in the past? Do you have any improvements to suggest about this technique?
Marc – have used this a lot, sometimes with the ?source pointing to a “success” page so people know their submission worked. Unfortunately there’s no equivalent for libraries, and the ol’ upload.aspx page is looking mighty ugly these days. Any ideas?
I like the idea of embedding list forms in a SharePoint page. I’d like to see some type of confirmation message after submitting the form. Not only is that typical of form submissions, it gives the user reassurance that what they did worked.
I’ve tried that, but because the form is in an iframe, you end up with the page chrome inside the iframe, which gets recursively weirder. This approach works well if people are likely to add multiple items, too.
To remove the iframed page chrome, we use a minimal aspx page with no Sharepoint gubbins, and just a simple success message – or if we want them to be able to see what they submitted, a script to redirect users to a page containing submitted items in a new window/tab..
What’s your trick for removing the SharePoint gubbins? I wanted to offer this up as a very low impact solution.
What do you think of passing values from Microsoft Forms to SharePoint from Power Automate? I’ve seen the Forms web used to good success as an alternative in SharePoint pages. For other web sites, embedding Forms seems like an even better option.
It’s one of the more used templates: https://preview.flow.microsoft.com/en-us/galleries/public/templates/2be590104bdd11e78896d10a96d3fac3/record-form-responses-in-sharepoint/
@resing:
Using Power Apps or Microsoft Forms gives a different (maybe nicer) experience, but my point in this post was definitely the “poor person’s” approach. This approach requires almost zero technical skills and no special licensing or permissions. In many orgs, Power Apps is verboten and linking a Microsoft Form to a SharePoint list requires a bit of work to set up the list to match the form (“column” names in Microsoft Forms can be hard to decipher, too) and write the flow.
M.
I see what you’re saying about it being more work to automate a form. Sometimes you don’t even need the data in a list. Having it in an excel file is fine. Forms is just easier for people to use, from my experience.
On using a list for this, there’s a tradeoff for the creator. Not having any confirmation leaves the user guessing if they succeeded. What seems easy on creation may be hard later when users need help.
I see what you’re saying, but I feel like data collected by a Form is a bit less durable than having that data in a list.
I agree