cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
EB77
Regular Visitor

using java script to refresh a form

 

 

 

7 REPLIES 7
chleverenz
Super User
Super User

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
Super User
Super User

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... 

 

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.

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!

OliverRodrigues
Super User
Super User

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




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

Power Pages Super User | MVP


Oliver Rodrigues


 

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?

 

OliverRodrigues
Super User
Super User

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




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

Power Pages Super User | MVP


Oliver Rodrigues


 

Yuva_saran1219
Regular Visitor

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

 

 

Helpful resources

Announcements
Carousel Community Blog

Check out the Community Blog

Read all about the most recent blogs in the community!

Carousel News & Announcements

What's New in the Community?

Check out the latest News & Events in the community!

Users online (3,854)