Need To Refresh Repeater data source after user click on Declarative action

sanjusanju2
Tera Expert

Hi All,

 

I have requirement where i need to display some pinned items from the list of records on the tiles like component. 

To Achive this, I have added a list component in my UI builder page, from my Risk table created in my studio application.

In list component i have also added a declarative action, like pin/unpin record from the list records.

Action is working fine, when i click my button from the preview page it is udating the record in the backend. To display these pinned record, we have create a data source (Top_pinned_records), where we are filtring the record based on our criteria. 

I created a repeater which is using data source Top_Pinned_records, to display the data. For decoration purpose i used carosual, and there i am using repeater, where i added the componenet card base container and card base header with styled text to mimic the tiles like component.

 

But when i am pinning or un pinning the record it is getting updated in the backend but it is not displaying on the page. When i refresh the page then repeater is displaying the udpdated record.

 

So I need step by step guide where i can refresh my repeater datasource which in result display the updated record immedeatly on the page.

 

1 ACCEPTED SOLUTION

@IronPotato Thanks for your suggestion, We have found a solution, where we have just added a event on the list like data fetch succeeded and in this event we have refresh the data source we have used for the repeater. After that it started refreshing the data. 

View solution in original post

5 REPLIES 5

IronPotato
Mega Sage

Hi @sanjusanju2 ,

 

From where is your repeater feeding the data? Directly from output of DR?

@IronPotato Yes, we have used a datasource to fetch the data and using the same datasource to display the output.

 

sanjusanju2
Tera Expert

Hi @IronPotato Yes, we have used data source for my repeater component to display the data.

Hi @sanjusanju2 ,

 

then switch repeater to script and log the data from your repeater and see if the changes are returned back

make sure that you are returning the data as well

 

console.log('repeater data', api.data.<yourDR>);

return api.data.<yourDR>