web
You’re offline. This is a read only version of the page.
close
Skip to main content

Announcements

News and Announcements icon
Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Pages / using java script to r...
Power Pages
Unanswered

using java script to refresh a form

(0) ShareShare
ReportReport
Posted on by 12

 

 

 

Categories:
  • Christian Leverenz Profile Picture
    1,214 on at

    Hi @EB77 ,

    sometimes its sufficient to set the href of the window again. Like this:

    window.location.href = window.location.href

     

    may be you could add an arbitraty parameter so that the cache is ignored 🙂 

     

    Does this help?

      Christian

  • ragavanrajan Profile Picture
    7,044 Most Valuable Professional on at

    Hi @EB77 

     

    I like the way @chleverenz is suggested. You can add it to your entity list custom javascript option. 

     

    If you are after periodic refresh then below is the solution from @hardikv. 

     

    NB: You may need to modify the logic depending on your need. 

     

    https://powerusers.microsoft.com/t5/Power-Apps-Portals/How-to-refresh-an-entity-list-periodically-or-by-clicking-a/m-p/1348728#M9735 

     

    Hope it helps. 
    ------------

    If you like this post, give it a Thumbs up. Where it solved your request, Mark it as a Solution to enable other users to find it.

  • EB77 Profile Picture
    12 on at

    Hi, 

    Thank you for your response!

    I'm really new into the field. If I want to add this Jquery or JS function to the Javascript section in the form, is it enough to add your command into this part?

    Because I think i need to reach the ID of button first of all. Should i find that in the source code of the page?

     

    Thank you in advance!

  • oliver.rodrigues Profile Picture
    9,482 Most Valuable Professional on at

    hi @EB77 every time you need to add JS code you need to encapsulate into a document ready event listener:

    $(document).ready(function(){
    // your code here
    });

     

    is your Modal an OOB modal coming via the Form? I have a code that might help but you might need to tweak a bit:

    $(document).ready(function () {
     AddRefreshOnModalClose();
    });
    
    var AddRefreshOnModalClose = function () {
     $(".modal-form-details").on("hidden.bs.modal", function () {
     $(".entitylist.entity-grid").trigger("refresh");
     });
    };

    In this example, I have an Entity List and the user can open the record details, which opens in a Modal Pop-Up.. once it's closed, I am refreshing the Entity List

  • EB77 Profile Picture
    12 on at

    Hi @OliverRodrigues 

    Thank you very much!!

    And in your example in this part: 

     $(".entitylist.entity-grid")

    Do you find these class or ID names from your browser code?

     

  • oliver.rodrigues Profile Picture
    9,482 Most Valuable Professional on at

    Yes, when working with client-side scripting for Portals, you will need to use your browser Dev Tools very often to figure out classes/IDs of elements

  • Yuva_saran1219 Profile Picture
    12 on at

    Hi@EB77,

    The reload () method in JavaScript is used to reload the webpage. The refresh button in your browser acts exactly like the reload method.

     

    For further information, go through this link https://www.w3schools.com/jsref/met_loc_reload.asp 

    This link will explain you step by step explanation, https://www.tutorialspoint.com/refresh-page-after-clearing-all-form-fields-in-jquery 

    Please reach out here for more information about Jscript https://www.dynamicslabs.io/ 

     

    Regards,

    Yuvarani

     

     

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

Season of Sharing Community Challenge Winners!

Congratulations to our community stars!

Kudos to our 2025 Community Spotlight Honorees

Expanding mentorship, skilling, and AI innovation

Leaderboard > Power Pages

#1
Mohsin Ali Profile Picture

Mohsin Ali 18

#2
11manish Profile Picture

11manish 16 Super User 2026 Season 2

#3
anirudhev Profile Picture

anirudhev 4

Last 30 days Overall leaderboard