Can we auto refresh a modern sharepoint online page without the need to use modern Script editor web part

john john Pter 1,065 Reputation points
2024-08-27T21:53:57.1566667+00:00

I have a modern sharepoint online page which show data from multiple custom lists using PnP Modern search web part. the issue with the PnP Modern search web part, is that it does not automatically update the list of items (incase new items are added/deleted to the underlying lists) unless you manually refresh the web page.

so is there a way to auto refresh a modern sharepoint page each let say 5 minutes? the only solution i found is to use something such as :-

https://github.com/pnp/sp-dev-fx-webparts/blob/main/samples/react-script-editor/README.md

but using this appraoch will allow end users to embed whatever script they want which will pose a security issue.. so how i can auto refresh a modern sharepoint page , without the need to embed script and hence allow end users to embed any script they want?

Thanks

Microsoft 365 and Office | SharePoint | For business | Windows
{count} votes

Accepted answer
  1. Yanli Jiang - MSFT 31,611 Reputation points Microsoft External Staff
    2024-08-28T08:43:48.9266667+00:00

    Hi @john john Pter ,Unfortunately, according to my research, there is no OOTB solution for now. You can try to add the JS code to SPFX and then upload it as a whole. This should not affect other users who can use their custom scripts.

    For your reference:

    https://learn.microsoft.com/en-us/sharepoint/dev/spfx/web-parts/guidance/use-existing-javascript-libraries


    If the answer is helpful, please click "Accept as Answer" and kindly upvote it. If you have extra questions about this answer, please click "Comment".

    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.

    1 person found this answer helpful.

0 additional answers

Sort by: Most helpful

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.