Is there JavaScript to listen for a webhook?

Hi! I’m trying to speed up response time in my apps. For instance, I use PayHere for payments… and a successful payment updates the row in GS that the user is in. However there is a latency of 15+ seconds for glide to update the device :frowning:

I was wondering if there was experimental code that would process a webhook and deliver a value to the glide ux faster.

I’m happy for the full data to arrive late, but I could use this ‘visibility’ webhook to find out in seconds if an action has taken place, then use this on the device to change the screen.

Make sense? Any ideas? Thanks!

1 Like

stripe is not working there ?

I can’t use Stripe in the native glide way for several reasons. Payhere is a front end to Stripe too.

Hello,
the webhook is very fast, but it’s not PayHere that is causing the delay?

No. The webhook from PH to the GS takes 2-3 seconds max. It is glide taking forever to recognize the change in a row in GS and pushing that change to the user’s device. That is 15 seconds, being generous, and can take 45 seconds.

Ah ok, so you want a webhook with value in return

Yes - so the YC column returns a toggle or timestamp in the glide environment …. Faster than the GS update :slight_smile:

can you explain why you cant use stripe? i never have any problem other than a glide fee on top :wink: 10% is quite a lot… but i know you are using pro… so it is only 2%

I cannot change quantity. I cannot support subscriptions. The glide Buy button has constraints such as only using basic columns. I can work around some of those issues, but eventually I gave up.

why is that? i do change quantity… just don’ base it on logic columns… and if you have to … then use set columns to set stable values when going to checkout, create user attached non user specific column to write calculated values to, when calculating price… like simple trick … button to confirm price… or go to secure check out… with action to set columns… but when your main source is GS you dont need any of the tricks… just adjust values there… glide will show change immediately if is simple action like increment or add value… or if more complicated calculation have a recalculated button to write

1 Like

I agree. This type of scenario remains a frustration.

In a totally different use case we use Glide to embed a Calendly link for bookings. When the booking is made, Calendly fires a webhook instantly which we catch in Integromat, again pretty much instantly. Then we use Integromat to update the Google Sheet which is where the delay kicks in. Often this can be 20 seconds which is sufficient for a user to become confused.

I believe that an integration between Glide and Integromat is underway and, if so, this may include the ability for Integromat to access a Glide Sheet for both reading and (important in this case) writing. That would mean Integromat acting as a “catcher” for 3rd party webhooks in order to “reflect” the details back into a Glide Sheet, hopefully with much faster update time.

3 Likes

To process the webhook response would be a nice feature

2 Likes

That’s what I am after :slight_smile: :slight_smile: :slight_smile:

Hola @Mark_Turrell

We have discussed this feature/solution before, when API column was released we thought we had the final solution to retrieve data fired by a Webhook (via Integromat or IFTTT) but there are still details to fix like how to handle the received data if it has many parameters, how to put it into Glide columns and don’t suffer a headache everyday :sneezing_face:

Anyway, API column is in development and we can’t use it.

But I think Yes-Code column can be used and useful for you. Of course, you aren’t going to create a Webhook, you will need to make an API call that PayHere supports by using a cURL command

The new challenge here with YC column is to fire it manually. YC is a computed column and doesn’t have an action to control it but I think we can figure out a workaround meanwhile.

I sent you weeks ago an email with this feature and idea if you want to review it and carry it out.

Saludos, feliz día!

2 Likes

You can’t listen to a webhook in a Code column because it runs on the user’s device. What you can do, however is implement a backend somewhere that listens, and that you can call into to wait for the result of the webhook. The flow would more or less be:

  • You generate a UUID or something to identify the transaction and save it in column A.
  • Column B is a code column that takes A as its argument, and all it does is call into your backend, passing A to it.
  • The backend, when it gets a call from the Code column, initiates the transaction, using A as an ID for it, and listens for the webhook.
  • It only responds back to the Code column when the webhook with A as the ID has arrived.

It doesn’t actually matter whether the transaction is initiated by the app or the backend, as long as the ID is consistent. If the app initiates the transaction, then the backend might get the webhook before it has gotten with the call from the Code column with that ID, so it’ll have to save those results.

I haven’t tried any of this, of course. Good luck!

5 Likes

I think glide can learn a lot from the integromat interface.
Integromat has the same problem. They do not now wich data comes and have to handle it.

And for the action design the integromat interface would improve glide.

2 Likes