Get rowid of the new row just created by a button click

hi folks,
When people hit “complete order” on my custom form, i create a new table in my installation table. I also need to send a webook so stripe and maybe an email client can do a few things.

I was hoping to just create the new row through glide, and then also send a webhook to stripe to create the invoice. The problem is, i don’t really have a way to send the invoice link and other information back to glide because i don’t have the RowID of the row i just created through the button.

If i send all the temporary row information through the webhook first , create the new row, then create the invoice it actually might work out because it only takes about 2 seconds to come through. Then i can use the ROWID it spits out to add the information from stripe back into glide.

Is this the best way of doing it or is there a way to retrieve that rowid that was just created through the button and use it in my webhook?

Yes, that is the only way to do it. Until Glide can have a search API, I guess. This is because you can only do a set column through a rowID.

At 1:45 in your video you ask about capturing the RowID for the newly created row via the HTTP module. Yes, that works. When you add a row using the API, the response will contain the RowID of the created row. You just need to tick the “Parse Response” box in your HTTP module, then you’ll have the returned RowID to use in subsequent operations.

The other suggestion I would make is to use a native form instead of a custom form. If you do this, you can use an onSubmit action to trigger your webhook, and the RowID will be available at that point. (I know this works, as I’ve tested it).

3 Likes

Nice trick with the parse response!!! I’ve been using a parse JSON module unnecessarily!

2 Likes