#Data table not always refreshing

1 messages · Page 1 of 1 (latest)

graceful stirrup
#

Problem: Table data source is from API request, but not always is refreshing the content when i made a new request to the same endpoint.

Using an asynchronous request is not resolving the issue.

I have a table with products data.
Process:

  1. Click the actions button in a row, this opens a phase change modal.
  2. Select new phase and submit, this opens a confirmation modal.
  3. Confirm change (here the request is made).
  4. Refreshes the table to see the change.

() Products table source data comes from API request.
(
) The Phase Change is done by request to the API.

halcyon hazelBOT
#

Hey! Could you show the code you have in both the modal submit button and t he
tables data field?

graceful stirrup
halcyon hazelBOT
graceful stirrup
#

We are going to have a hundred thousand results, using storeValue() is not scalable.

graceful stirrup
#

the API response may take a few seconds. When it responds quickly the table is updated, but when it takes several seconds, it does so asynchronously.

halcyon hazelBOT
#

I am sorry you are experiencing these troubles. We have raised the issue
internally and are investigating this. We'll get back to you asap.

worn tiger
#

Hey, @graceful stirrup is it possible for you to share the app with us? It's difficult to figure out from the screenshots

graceful stirrup
#

Hey @worn tiger I'm not able to share the app due to sensible data but we could schedule a meeting in order to review the code.

strong musk
#

Hey @graceful stirrup

Instead of calling the API the application is calling JS function that only returns data after manipulation. Application will instead need to make API call in successChangeStateMachine .

So, instead of this code return JSGetProductData.getProductData()

user will need to write

 user_products.run()```
halcyon hazelBOT
#

@graceful stirrup We see at the top of your function you're referencing
selectStages.data, user_products.data, and products.data. However, we
never see you call the run functions associated with these. Can you show us
where and when selectStages.run(), user_products.run(), and products.run()
are called?

graceful stirrup
#

I must manipulate the API response before populating the table.

#

The post request to qa_change_stage_machine_phase produces several asynchronous processes, when we receive a quick response the table get refreshed but when it takes several seconds Appsmith doesn´t wait for a response. I solved the problem setting a one minute time out.

halcyon hazelBOT
#

So the issue was that the API failed/timed out. Thanks for sharing the solution.