Custom HTML block not receiving data from get-record-item-details event on Item Details page

I have a page “My Yacht Charter” with an Item Details block connected to my Deals table, using Record ID from URL. I also have a Custom Code block on the same page that listens to the softr:get-record-item-details event to display dynamic data (yacht photo, client name, payment status, etc.).

The event listener is set up correctly but the data is not being received by the custom block. The block renders but all dynamic fields are empty.

My code:

javascript

window.addEventListener('softr:get-record-item-details', function(event) {
  console.log('Event received', event.detail);
});

The console never logs anything. Is this event still supported? Is there a timing issue or a different event name I should use?

Hi @Mathieu

If I got the use case correctly, then the event name should be “get-record”. Please check this documentation for the details, I think that should be helpful - Custom Code Events and Style Selectors – Softr Help Docs

Works fine for me with the following changes:

  • remove “softr:”
  • replace “item-details“ with the actual name of the block that includes the item details.

window.addEventListener(‘get-record-item-details’, function(event) {
console.log(‘Event received’, event.detail);
});

1 Like

Glad to hear that!