Trigger workflow when user scrolls to top of RG or other scrollable element

I have a RG. I want a workflow to be triggered when the user scrolls to the top of the Repeating Group.

My proposed solution with Javascript Toolbox plugin (But I don’t know how to get it to work)
It seems like I can achieve this by having Javascript “listening” for when the user scrolls to the top of the RG and then having a ‘Javascript to Bubble’ element triggering a workflow when the listener returns a value of ‘success’ when the user scrolls to the top of the RG. Could anyone provide me with steps on how to get this to work as I haven’t got much experience with JS and having trouble.

Thanks for any help or solutions

1 Like

For others with same problem - I solved this with the bubble toolbox plugin.

  • Add “Javascript to Bubble” element to page. Give the function a name. Tick the box
    “trigger event”

  • Give ID name to the element/RG you’re trying to detect scrolling position of

  • Create ‘On page load’ workflow → run javascript →

    var element = document.getElementById(“YOUR ELEMENT ID”);

    element.addEventListener(“scroll”, function() {
    if (element.scrollTop === 0) {
    bubble_fn_NAME OF YOUR JAVASCRIPT TO BUBBLE FUNCTION();
    }
    });

  • Create a “Javascript to Bubble event” workflow. Select the JS to Bubble element. Adjust the workflow actions

2 Likes

This topic was automatically closed after 70 days. New replies are no longer allowed.