Need to refresh the app so my changes take place

I’ve been using API calls for a while now to update values of the rows in one of my tables, I didn’t have any issues with them. For this, I have a button with an action that consists in:

  • a POST API call to a big table to update values.
  • a ‘reload table’ component to reload that big table where I did the changes.
  • a ‘show notification’ component

However, from almost a month ago, I’ve been having issues when I try to make two API calls one followed by the other (basically, clicking the button, waiting for the action to be done, and then clicking the button again). What happens is:

  • Clicks the button the first time: the values get updated
  • Clicks the button the second/third/fourth/… time: the values don’t get updated.

I’ve had to resort to refreshing the browser after the first click and then clicking the button again so it works fine, but I don’t get why it’s failing now when it hadn’t failed before in the five months I’ve had with my app.

I can’t explain the behaviour, but I do have a couple of suggestions:

  • Firstly, is there a reason why you need to send separate updates? Why not send them all together as a single update?
  • Secondly, an alternative option could be to use the Make integration.

I can’t send a single update. I know it might sound silly, but I can’t go into too much detail about the app since it’s a work thing. Basically, imagine that for each update I’m saving payments I’ve done. It’s not the same to say I made a $10 payment and then a $20 one that to say I made a $30 payment (since when I go to my bank account, it will show $10 and $20, not $30).

I haven’t read about the Make integration, I mostly use Zapier, but I will look into it.

Thanks!

Perhaps my original reply was poorly worded. What I meant was you could send both updates in a single API call, rather than multiple calls. The Glide API will accept up to 500 updates (mutations) in a single call.

Oh yeah, I got confused with the word updates, but I do pass multiple mutations in a single call.
To illustrate what I meant about the payments, let me give you an explanation:

  • I have a table of invoices, they have five columns: Amount, Paid amount, To_Pay amount, Payment_ID and ‘Is_Paid’ (boolean that checks true if To_Pay amount equals 0).

  • I have a table of payments with two columns: Payment_ID, Payment_Amount.

The idea is that whenever I make a payment, the n invoices that got paid with it update their amounts, this in FIFO order.

By example, a simplified version of my invoice table looks like this:
‘cheeseburger invoice. Amount: $10, To pay: $10, Paid: $0, Payment_ID: (empty)’
‘cinema invoice: Amount: $15, To pay: $15, Paid: $0, Payment_ID: (empty)’
‘phone bill invoice: Amount: $30, To pay: $30, Paid: $0, Payment_ID: (empty)’

let’s say I submit a $25 payment (ID: #1). It’s going to update the invoice table to this:

‘cheeseburger invoice. Amount: $10, To pay: $0, Paid: $10, Payment_ID: #1
‘cinema invoice: Amount: $15, To pay: $0, Paid: $15, Payment_ID: #1
‘phone bill invoice: Amount: $30, To pay: $30, Paid: $0, Payment_ID: (empty)’

Now, I made a $30 payment (ID #2). It’s now going to look like this:
‘cheeseburger invoice. Amount: $10, To pay: $0, Paid: $10, Payment_ID: #1
‘cinema invoice: Amount: $15, To pay: $0, Paid: $15, Payment_ID: #1
‘phone bill invoice: Amount: $30, To pay: $0, Paid: $30, Payment_ID: #2

They were two payments so I had to press my button twice. What is happening right now is that, if I do not refresh the website, the second time I press the button and the action does the API call to update my invoices, the values are not getting updated, so it looks like my phone bill was never paid.

Of course, I could just say I made a $50 payment, but that’s not the idea since in real life I made two different payments.

I hope I’m being understood, English is not my first language and I can’t give too much details about the app.

Okay, understood.

Can you have a look in the associated action run log?
You should be able to see in there the actual payload that was sent with each run.

Also, which column types are involved in preparing your JSON payload?

First, I use a javascript column to generate the mutations, then a template column to add the information about the appID, finally I use a Query JSON column to parse the values.

image

Funny, though. As I said before this whole process was working until almost a month ago when it started failing a lot (among other parts of the application I’m working on). An hour ago I got a message saying ‘a new version of Glide is available, reload’. I’ve been doing a lot of tests since this morning, but after clicking on that button everything is back to normal and the updates are taking place.

1 Like