How to hide welcome message for an empty SharePoint List?

Summary

Create a new custom list, you will notice this new list will have the following message as shown below.

An image.. + “Welcome to your new list” + “Select the New button to get started”

The custom welcome message for the empty list.

This post should help you to hide the welcome message.

Step By Step Solution

Step # 1: Create a column hideWelcome Yes/No Type and default value as No.

Create a hideWelcome column,

Step # 2: Add a dummy first row with hideWelcome as Yes for this row.

Add a new row for this hidewelcome column as Yes

Step # 3: Add the View Formatter JSON code for the trick.

{
  "$schema": "https://developer.microsoft.com/json-schemas/sp/v2/row-formatting.schema.json",
  "hideColumnHeader": true,
  "hideSelection": true,
  "debugMode": true,
  "rowFormatter": {
    "elmType": "div",
    "style": {
      "display":  "=if([$hideWelcome], 'none', '')"
    },
	"children": [
	  {
		"elmType": "div",
		"txtContent": "[$Title]",
		"style": {
		  "flex-grow": "1"
		}
	  }
	]
  }
}

The first row with the hideWelcome as Yes will hide the welcome message.

The hidden welcome message

Conclusion

The above trick may not work for all scenarios. As I have not tested all scenario. This is a technique to hide the welcome message based on the hidden field named hideWelcome.

Unknown's avatar

About Pankaj

I am a Developer and my linked profile is https://www.linkedin.com/in/pankajsurti/
This entry was posted in SharePoint, Technical Stuff. Bookmark the permalink.

3 Responses to How to hide welcome message for an empty SharePoint List?

  1. Julie Bird's avatar Julie Bird says:

    This is brillient, got me out of a big hole when adding list webpoarts to sharepoint pages πŸ™‚ Thanks for sharing!

  2. Cindy B.'s avatar Cindy B. says:

    This appears to be exactly what I need, however, when I apply the code exactly as shown, it returns an error in the hideWelcome column that reads “Failure: Must specify elmType.” Any idea what may be causing this?

  3. Nikos Skatz's avatar Nikos Skatz says:

    Same error to me. You must specify elm type

Leave a reply to Cindy B. Cancel reply