Page Library - new column with required field, how to prevent page creation if required field not filled
-
08-02-2021 - |
Вопрос
Here's my problem: In my default page library I have added the column "Content type". This contains a selection list (manual, source code, etc.) and can be edited via drop-down menu. I have set this field as a required field. Now when I create a page (start->"New menu"->page) and open the page properties, I see that my field is a required field - there is a small asterisk after the name and it is written in red. If I do not fill this field, I can still save the page. How can I prevent this? Users are required to fill in this field, how can I ensure that?
Решение
This is by design in SharePoint Online Modern experience.
The list items/library files with incomplete/missing information will be shown in separate view called Items/Files that need attention like below:
Also it will show small message of Required info in column in list view (see in above image).
Workarounds:
- Set Default value to your "Content Type" column from column settings.
- Use Approvals in SharePoint - You can approve the site pages only after all information is filled for the newly created pages.
Update:
Setting default value to column:
- Go to Site Pages --> Library settings.
- Navigate to Columns section and click on the column name "Content Type".
- Scroll down to Default Value and set one of the choices in textbox below it.
- Click OK.
Default Value Set automatically to Newly created Page:
In Site Pages Library:
Другие советы
Very interesting question, I don't know if there is another OOTB solution for it.
But i recommend you to work with SharePoint Approvals, don"t approve the site pages until the required information are filled.
I have this before and solved by:
- Create site column and make it required
- Add the site column to content type
- Add the content type to the page library
Hope this will help
This is how it is... You cant prevent users from saving/publishing pages with an empty required field. But you can vote for this feature: https://sharepoint.uservoice.com/forums/329214-sites-and-collaboration/suggestions/39672985-prevent-saving-of-site-pages-if-a-required-field-i