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

Community site session details

Session Id : +qyFM/1HKFjGfBr/NksCHA
Power Pages - Power Apps Portals
Unanswered

using java script to refresh a form

Like (0) ShareShare
ReportReport
Posted on 27 Jan 2022 16:30:44 by 12

 

 

 

I have the same question (0)
  • Christian Leverenz Profile Picture
    1,214 on 27 Jan 2022 at 16:57:57
    Re: using java script to refresh a form

    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,036 Most Valuable Professional on 27 Jan 2022 at 20:37:43
    Re: using java script to refresh a form

    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 28 Jan 2022 at 09:54:43
    Re: using java script to refresh a form

    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,347 Most Valuable Professional on 28 Jan 2022 at 10:14:59
    Re: using java script to refresh a form

    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 28 Jan 2022 at 10:58:49
    Re: using java script to refresh a form

    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,347 Most Valuable Professional on 28 Jan 2022 at 11:20:31
    Re: using java script to refresh a form

    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 19 May 2022 at 07:27:37
    Re: using java script to refresh a form

    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

Responsible AI policies

As AI tools become more common, we’re introducing a Responsible AI Use…

Chiara Carbone – Community Spotlight

We are honored to recognize Chiara Carbone as our Community Spotlight for November…

Leaderboard > Power Pages

#1
Michael E. Gernaey Profile Picture

Michael E. Gernaey 45 Super User 2025 Season 2

#2
Fubar Profile Picture

Fubar 44 Super User 2025 Season 2

#3
Jerry-IN Profile Picture

Jerry-IN 40

Last 30 days Overall leaderboard
Loading complete