Custom code to trigger a webhook alongside a click of the new action buttons? (getElementById / querySelector)

Hi builders, I am trying to figure out the IDs of the new action buttons so I can use custom code to trigger webhooks (in addition to opening the link as per open url of the action button); the following should work as far as I understand but currently does not yet work…

var button1 = document.getElementById(‘button1’);
console.log(button1);

I also tried querySelector (to be able to find the first of several buttons in one element) but its not working either:

var button1 = document. querySelector(‘#button1’);

thanks in advance for any pointers!

stephan

I will let @artur answer you as I didn’t check this already. But I’m pretty sure this wouldn’t be that simple, for example, with the CTA buttons I need to play with the Css pseudo class :nth-child()… (see an example here New - unofficial - feature: TABS - Hide/Show multiple blocks horizontally) or with button index.

1 Like

Hey folks I’m not sure we have added persistent selectors to those. I will ask the team to add so you can easily select them.

1 Like

@artur, any updates on this?

I am trying to solve for submitting data to a webhook upon action button click as well.

Any updates here?

thanks for your help in prioritizing this as the current new buttons are not very helpful for me without being able to select them with custom code…

I’m looking to do the same. I saw this video How To Build A Booking Portal with Softr.io | No-Code Tutorial - YouTube which goes over how to do just that but can’t find the code snippet used in the video. I reached out to the Jamie who put the video together and will post if/when I get a response.

Wanted to share a work around for how to trigger automations with a button. Softr will release a Make trigger sometime before September but I’m not sure if this will allow users to pass a recordID of the list detail and the related list.

You can see the video here for the work around. Level Up Your Softr No-Code App Build With Action Buttons | Softr.io Tutorial 2022 - YouTube

I managed to make this hack work. Essentially you create a form in softr and then add your own URL parameters by using the Concatenate function in airtable to generate a custom iframe link that is then used within the embed field in softr. The video goes over this but not in as much detail as I would have liked.

First you create a form on a blank page.

Copy that embed code

build out a field in airtable in the table that holds the data where you want the action button

You need to append your own parameters within airtable to the embed code after the scr = ‘hhtp://softr-embed-link’ within the iframe code. Using lookup fields in airtable you can pass related table recordID’s. (the format is http://url?key=value&key=value) You might want to use the ENCODE_URL_COMPONENT so that illegal charectars don’t cause issues if you are passing something other than recordID’s.

You can also access the logined in user’s table. This offers the ability to potentially store a value in the user table and then retrieve that value for use on anouther page. For example one button sets a state or passes a record ID in the user table that is then used in the form. I haven’t worked with this yet.

See the custom value field and Logined in user fields. Layout: Customizable Form

THere might be a way to use this sytax to get other records besides the loggin user {LOGGED_IN_USER:FIELD:‘field name’} but didn’t get much clarity on that from Softr.

I think there might be way to capture the current list detail recordID that is always in the URL and pass that to the embeded form, but I haven’t figured that out yet. Will let you know when I do.

1 Like