Forum Discussion

cprothero's avatar
cprothero
Iron Contributor
Sep 25, 2020
Solved

List View Formatting - Conditional Message when there are no items?

I am using List View Formatting already on one of my lists, but I would like to be able to show a custom message when a particular view has no items in it. My use case is a view of employee anniversaries. The list view shows people with an anniversary today but occasionally there are none, so I would like to just have a message that says "No anniversaries today" other than the default message that says something like "Welcome to your new list". 

  • Hello,

    Perhaps this could be solved with a Power Portal? Using a Power App to control and display content. Power Automate to create triggers and desired actions.

    Tip: Listen to the recent episode of the Intrazone podcast. Omar Shahine has built a similar solution.

7 Replies

  • As Aref said the best bet here is using a power app and then creating a SharePoint page and add the app as a web part. You can then serve up the data from the list through the app and customize it how you want too. There really isn’t an OOTB way to change how the list displays no items. You can only conditionally format item rows / columns themselves.
    • cprothero's avatar
      cprothero
      Iron Contributor
      Okay, thanks for confirming that. I'm not a big fan of how long power apps take to load on a SharePoint page, but I guess it is what it is.
      • jpittman_mygn's avatar
        jpittman_mygn
        Copper Contributor

        cprothero 

        Little late to the party but I found the following CSS that you can use if you're using a tool like the Modern Script Editor web part. Have done this a few places in our tenant where we can't afford to wait for Microsoft to give us cleaner UI options 😅

        <style>
            div[data-automationid='emptyFolderContainer']{display:none !important};
        </style>

         
        Fun note, this is the only place so far that I've seen "data-automationid" listed in the HTML instead of "data-automation-id". We can probably expect this CSS hack to break just as soon as somebody on the SharePoint dev teams realizes they missed a "-" in their code 😜


  • Hello,

    Perhaps this could be solved with a Power Portal? Using a Power App to control and display content. Power Automate to create triggers and desired actions.

    Tip: Listen to the recent episode of the Intrazone podcast. Omar Shahine has built a similar solution.