Sometimes, in Power Pages, you may need to programmatically refresh the entity lists. For example, you called an API and made some changes to one of the records in the subgrid. It will not be visible until you refresh the page or the grid. Since Power Pages does not offer a built-in refresh button for entity lists, this can pose a challenge.

Moreover, there is no officially documented method to refresh entity lists dynamically. However, upon inspecting the entity list using dev tools, we can observe an event listener on the grid for an event named refresh.

inspecting entity list event listeners

Using JavaScript, you can leverage jQuery’s trigger method to fire this refresh event programmatically. Below is an example of how you can achieve it:

JavaScript
$('.entity-grid.entitylist').trigger('refresh');

This line of code effectively refreshes the entity list without requiring a full page reload, ensuring your updates are visible immediately and providing a good UX.