Send POST request from a button

Hi Pesan. Sorry for my slow reply - didn’t notice your comment here.

From looking at your screen snip, I can’t see a column for the sharing link for the folder you want to open. I would suggest adding a ‘Folder URL’ column, and then using the following formula in your ‘Open’ button:

if(thisRow.[Folder URL].IsBlank(), concatenate("https://hook.integromat.com/xxxxxxxxxxx?RowID=", thisRow.[Order ID]), thisRow.[Folder URL])

Note the “xxxxxxxxx” above should be replaced with the unique identified for your webhook.

The formula above effectively says “If we don’t have a folder URL, then fire a webhook to create a folder, and include in the webhook the Order ID so that Integromat can find this row via the Coda API. Alternatively, if we do have a folder URL, then open the link in a new window”.

Once your Integromat scenario has created a folder and retrieved the sharing link for that folder, it will need to update the row in Coda, to populate the link URL in the ‘Folder URL’ column. To do that, you will obviously need Integromat to look up the relevant row in Coda, using the Coda-generated row key (your ‘Order ID’ column) which you passed to Integromat in the webhook as ‘RowID’.

I hope that helps!

Though no official http requests packs, one hack is to use the Image(url) and set the params method=POST to send to your server.

3 Likes

@Kepler_Liu this is a great idea. Have you run into any trouble with it? Does it work reliably? I guess you need to kill the Image at some point in your chain (maybe via API) so your endpoint doesn’t get hammered with the same info every time someone views the row.

That trick to close the tab is killing! Loved it!
I’m currently building a few integrations with integromat, to connect Coda with a Lead Management System and that tab hanging there was killing me!

I’m trying to set this up because I’d also love to have my tabs auto close.

But it doens’t seem to be working. Is there something else I should be doing in the response module?

image

Hey Aaron, did you ever figure this out?

If you’re having trouble with getting the window/tab to close, it’s because of browser standards. That’s likely why different people are getting different levels of success with the methods mentioned in this thread. I’ve been trying to find a workaround with no success.

Here is the error I’m getting in the Chrome browser console: “Scripts may close only the windows that were opened by them.”

More info: window.close() Restrictions – text/plain

If anyone has any better ideas, I’d love to know!