Skip to main content

Notifications

Community site session details

Community site session details

Session Id :
Power Automate - Building Flows
Suggested answer

Force sharepoint page refresh to update image web part ?

Like (0) ShareShare
ReportReport
Posted on 19 Dec 2024 14:12:46 by 59

As you can see from my question in the sharepoint forum : https://answers.microsoft.com/en-us/msoffice/forum/all/sharepoint-page-image-web-part-not-refreshed/5730730b-3ecf-48ee-a3c7-cf622445d619?messageId=1d02795f-8817-4484-b0ce-169a5c85e32a

 

I have a power automate flow that will generate pictures that are saved/overwrite in a sharepoint library. (can be sitepage or another library).

I also have a sharepoint page that show theses pictures in an image web part.

Unfortunately, the pictures are not refreshed, or at least there is a big delay for the page to sync back. I understand it's part of the way sharepoint are built.

I was hopping there was a way to ask sharepoint to refresh that page. Trigger a refresh instead of waiting for the delay trigger. May be using rest-api, but I couldn't find that information.

Anyone have an idea ?

Thank you

  • Suggested answer
    Watever Profile Picture
    59 on 18 Feb 2025 at 17:07:32
    Force sharepoint page refresh to update image web part ?
    In case anyone is searching for this.
     
    The way to do it, is to rename the filename of the file you are uploading to. If the name is different, it will be downloaded instead of using the cache.
    But if you delete and reupload the file with the same filename, it won't work cause the sharepoint page won't find the pictures anymore. It need to have the same ID not identifier.
     
    To make this work, I created a flow, that search in the specific folder for the file that start with the filename I want to update.
    Exemple : Search in "Folder 1" for "Filename1" even if the filename is Filename1_somethingelseblahblahblah.jpg", you want to find it.
    Then you will update your new file/pictures using the full filename. So the updated pictures will be named Filename1_somethingelseblahblahblah.jpg, meaning it will have the SAME ID as the previous version.
    Then you will rename that file with a incremental trigger or timestamp, etc...
    I prefer to use the timestamp, that way you know when it was updated, and easy to implement.
    (You need to use an HTTP Request to rename a file in sharepoint, unfortunately it's not an easy step, but not really complicated once you know and can do copy-paste).
     
    Then the sharepoint will refresh the cache with that new version, so you will end up with an updated page.
     
  • Watever Profile Picture
    59 on 19 Dec 2024 at 15:44:15
    Force sharepoint page refresh to update image web part ?
    Thank you David,
     
    That's what I was thinking.
    What is weird is that even if I can see the new image in the browser and refresh it there, it will not be refreshed in the page.
     
    I could change the filename or add version to it, but not sure how I would do that in the sharepoint page automatically.
  • David_MA Profile Picture
    10,858 Super User 2025 Season 1 on 19 Dec 2024 at 14:56:23
    Force sharepoint page refresh to update image web part ?
    The simple answer is that you cannot do this with Power Automate. The issue is more related to the browser cache than anything else. Here are tips for getting the browser to refresh the images: Overcoming Persistent Image Caching: How to Ensure Visitors See Your Latest Website Changes? | by Gulshan N | Medium

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

🌸 Community Spring Festival 2025 Challenge Winners! 🌸

Congratulations to all our community participants!

Warren Belz – Community Spotlight

We are honored to recognize Warren Belz as our May 2025 Community…

Congratulations to the April Top 10 Community Stars!

Thanks for all your good work in the Community!

Leaderboard > Power Automate - Building Flows

#1
stampcoin Profile Picture

stampcoin 97

#2
Michael E. Gernaey Profile Picture

Michael E. Gernaey 72 Super User 2025 Season 1

#3
David_MA Profile Picture

David_MA 48 Super User 2025 Season 1

Overall leaderboard
Loading started