# Scrolling in view when using view containers does not work

**URL:** <https://community.appfarm.io/t/scrolling-in-view-when-using-view-containers-does-not-work/1105>\
**Category:** Ask the community\
**Tags:** scroll, view-container\
**Created:** [March 12, 2024, 12:47pm UTC](https://community.appfarm.io/t/scrolling-in-view-when-using-view-containers-does-not-work/1105 "2024-03-12T12:47:03Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Johan18](https://dub1.discourse-cdn.com/flex013/user_avatar/community.appfarm.io/johan18/32/748_2.png) [@Johan18](https://community.appfarm.io/u/Johan18)\
**Post date:** [March 12, 2024, 12:47pm UTC](https://community.appfarm.io/t/scrolling-in-view-when-using-view-containers-does-not-work/1105/1 "2024-03-12T12:47:04Z")

</div>

Hi  
I have an action that will open a view and scroll down to the relevant part. This is normally quite easy by marking the container with element id and open url with #elementid as url.

However, when I try to do this from an action that first loads the subview, it does not find my element from the action. It seems it is in the context of the parent container and hence does not find the element id in the subview.

I have tried both “open url” action parameter and also run code:

document.getElementById(‘mynotes’).scrollIntoView({behavior: “smooth”, inline: “nearest”});  
resolve()

TypeError: Cannot read properties of null (reading ‘scrollIntoView’)  
when using url it gives no error, but does not scroll to the container.

What would be the best workaround for this? Im thinking I could set up an app variable when I want it to scroll in the subview, then an on view load action on the subcontainer. But it is quite ugly so I would rather make it work from the other action, if possible.

Thanks.

Thanks

---

<div class="post-metadata">

**Author:** ![Simona](https://dub1.discourse-cdn.com/flex013/user_avatar/community.appfarm.io/simona/32/201_2.png) [@Simona](https://community.appfarm.io/u/Simona)\
**Post date:** [March 14, 2024, 8:16am UTC](https://community.appfarm.io/t/scrolling-in-view-when-using-view-containers-does-not-work/1105/2 "2024-03-14T08:16:39Z")

</div>

Hei @Johan18

I’m not entirely clear on your setup based on the explanations provided. Could you please demonstrate it with screenshots? This would include visuals of the UI structure, the location of element IDs, and the actions you’re referring to. It would help me better understand the context and provide more accurate assistance.
