how to auto refresh a webpart in a sharepoint page

Rodriguez Mauro 1 Reputation point

112186-captura-de-pantalla-2021-07-06-115540.pngI have a sharepoint with a page that shows embedded reports. The inserted reports are from google studio. I would like that insertion of the report (webpart) to update every 1 minute for example, automatically. The idea is that the user can always see the updated information.

Does anyone know if this is possible and how?

I've been seeing that they do it with some javascript scripts, but I understand that in sharepoint 365 you cannot inject javascript code using the "<script </script>" tags.

here you can see the report I need to keep updated


A group of Microsoft Products and technologies used for sharing and managing content, knowledge, and applications.
9,567 questions
0 comments No comments
{count} votes

1 answer

Sort by: Most helpful
  1. CaseyYang-MSFT 10,321 Reputation points

    Hi @Rodriguez Mauro

    In SharePoint online modern page, for security reasons, modern web parts do not allow for the insertion of code like JScript. But you could add Modern Script Editor web part by adding an app.

    1.Settings > add an app > Modern Script Editor web part by mikaelsvenson
    2.Remember allow Custom Script in Classic SharePoint admin center > setting > Custom Script
    3.Then you could add Modern Script Editor web part
    4. As a workaround you could use the following JS code to refresh the page every 1 minute

    If an Answer is helpful, please click "Accept Answer" and upvote it.

    Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.