how to auto refresh a webpart in a sharepoint page

Rodriguez Mauro 1 Reputation point
2021-07-06T14:53:46.577+00:00

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

9mSeSZr5r3QPJF9n9

SharePoint
SharePoint
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
    2021-07-07T07:59:30.003+00:00

    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
    112448-1.png
    2.Remember allow Custom Script in Classic SharePoint admin center > setting > Custom Script
    112478-2.png
    3.Then you could add Modern Script Editor web part
    112479-3.png
    4. As a workaround you could use the following JS code to refresh the page every 1 minute
    112496-5.png


    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.