Save place in repeating group when navigating to dynamic page

I have a list of items that show up in a repeating group based on filters I have set up. If a user clicks on one of these items, they navigate to a page about that item. If they use the browser’s back function, they’ll go back to the list—but not to the point they were at in the list.

I’d like my repeating group to “remember” where someone was on the list when they go back (essentially, anchor to the item they last clicked on) , but I’m not sure how to set a condition based on a browser action.

Hi there, @nico2023… I switched to using a custom state for my suggestion in this thread (it’s a single page app, though), but the concept is still the same, and I think the thread might be useful here (it certainly couldn’t hurt to check it out).


Thanks for pointing me to that thread! I like the solution using URL params but I’m stuck trying to figure out the very last step to extract the scroll position from the URL to actually scroll on the page on load. The scroll workflow only lets you set elements to scroll with a set offset:

@mikeloc I’m also trying out the solution you mentioned with Javascript, but I’m not sure what specific code to add here:

Give this a shot… window.scrollTo(0, Current User's Scroll position);

That didn’t work for me for some reason, but I found another solution that I think works well (and seems to work whether the user is logged out or logged in):

Basically, I added a data field to Users for their last viewed Brand (a data type) that logs whatever item from the repeating group they clicked on. When they go back, on page load, I’m able to tell the workflow to scroll to that entry in the repeating group. This has a couple advantages over the scroll location in pixels:

  1. Knowing the last Brand users look at could be a valuable metric for me to log.
  2. The repeating group is currently listed in order of last modified date, so if the Brand happens to be updated between the user clicking through and going back, the scroll position would be incorrect but the Brand last viewed is consistent even if its ranking moved.

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