How do I remove old data from a data grid

0
I am making a REST call that populates a datagrid. How do I clear the results of the previous search from the datagrid before displaying the results of the new search?
asked
4 answers
1

If you are associating the results to one object you could first retrieve the previous results and delete them. Then call the rest service and set the new objects. Or you could set the association on the one object to empty. These returned objects, if they are in memory, will be cleared up by the garbage collector. However if you want to permanently remove them from memory as soon as a new REST service is called then retrieve the objects and delete them. Does this make sense?

Your other option is to use the microflow data source on a datagrid. That way everytime you come to that page your microflow to retrieve the data via REST will be called and it will only be the new objects, because it isn't associated to anything on the page.

answered
0

Hi Mark,

Use the object change object action and tick the "refresh in client" boolean when you are retrieving your new data

answered
0

Hi Sebastiaan,

I've done as you suggested and the data grid is still showing data from a previous search when I click the search button.

I've set up the microflow so that the REST call returns a List. I have then created a loop to run through this list and placed the change object action inside the iterator to bind the iterator to an object. This object is then passed to the data grid on the page.

Am I doing anything else wrong do you think?

answered
0

Thanks Simon - I did as you suggested; retrieved the previous results and then deleted them before carrying on with the rest of the microflow. This has created the desired effect :)

answered