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

Notifications

Announcements

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:
I have the same question (0)
  • 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,368 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,368 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

Forum hierarchy changes are complete!

In our never-ending quest to improve we are simplifying the forum hierarchy…

Ajay Kumar Gannamaneni – Community Spotlight

We are honored to recognize Ajay Kumar Gannamaneni as our Community Spotlight for December…

Leaderboard > Power Pages

#1
Jerry-IN Profile Picture

Jerry-IN 71

#2
Fubar Profile Picture

Fubar 62 Super User 2025 Season 2

#3
sannavajjala87 Profile Picture

sannavajjala87 31

Last 30 days Overall leaderboard