function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
SFDC Forum 9SFDC Forum 9 

How to refresh section in lightning component

Hey folks,

Is there any tag to refresh particular section in lightning component from init function every n seconds.
VinayVinay (Salesforce Developers) 
Hi,

Review below links which has examples.

https://salesforce.stackexchange.com/questions/174741/how-to-refresh-the-specific-lightning-component-not-the-lightning-page
https://blog.sujeshram.com/2016/11/refresh-component-or-sections-in.html

Hope above information was helpful.

Please mark as Best Answer so that it can help others in the future.

Thanks,
Vinay Kumar
AnudeepAnudeep (Salesforce Developers) 
Hi, 

You will have to use the window.setInterval method of Javascript to achieve this

Use $A.get('e.force:refreshView').fire(); in your window.setInterval method 

Here is an example code
var interval = window.setInterval( $A.getCallback(function() { 
$A.get('e.force:refreshView').fire(); 
), 2000)
http://https://developer.salesforce.com/docs/component-library/bundle/force:refreshView/documentation

Anudeep