Add function to CRUD-buttons in a list block to trigger the reload of another list block

Dear Softr,

My use case is a menu card where users can configure a house. This requires some conditional filtering (e.g.: when a flat roof is selected, roof tiles are not applicable so they’re filtered from remaining possibilities that the user can see and select).
Now I have this functionality operational (with use of Make the choice are recorded in Airtable - and the user is redirected to the specific menu where they make their selection). BUT: when the user wants to remove one of their choices (with a delete button in a List block), this needs to trigger that certain filtered options (in another list block) become visible again.
Can you help to fix this? At this stage I believe I need to ask the user to reload the page manually.

Hi,

You would be able to do this by adding this code in the page settings => custom code => footer

<script>
window.addEventListener('block-loaded-list1', () => {
    window.addEventListener('delete-record-success-list1', () => {
        setTimeout(() => {
            window.dispatchEvent(new CustomEvent('reload-block-list2'));
        }, 1500);
    });
});
</script>

You just need to replace list1 and list2 by the ID/names of your lists