We have added two event listeners for Action Buttons Update Record action.
update-record-success event with field values is triggered after getting a response with a success status. update-record-failure event is triggered after getting a response with an error status.
window.addEventListener('update-record-success-list1', (e) => {
// e.detail is an object with updated field names and values
console.log('update record success', e.detail);
// update record success {
// payload: { "Full Name": "Softr" ... },
// id: "rec123456"
// }
});
window.addEventListener('update-record-failure-list1', (e) => {
console.log('update record failure', e.detail);
// update record failure 'Email field is required.'
});
// To reload the page after record update on #list1 block
window.addEventListener('update-record-success-list1', () => {
window.location.reload()
});
For âadd recordâ action buttons, should I use âsubmit-form-success-formXâ and âsubmit-form-fail-formXâ as event listeners or âadd-record-success-listXâ and âadd-record-success-listXâ?
hi @artur thanks for looking into this. I would like to add stuff like calling fathom events or make.com webhooks etc when someone clicks on a button (mouse over might also be an interesting event). Ideally the generic list click (not the action button) would also have a selector. Thank you!
Hi, would it be possible to have event listeners for Open URL action buttons on list block ?
I use webhooks URLs from Make and would like to use custom code to add logged-in user data (email and full name) in the data sent to Make.