Notifications
Announcements
Hi-
I have a scrolling screen in a canvas app with a lot of controls. Is there a way I can create a series of anchor links on the side of the screen that will allow users to click and jump to a particular label? I can create the list of links on the side that scroll with the screen, but can't get them to successfully jump to a particular label.
Thank you!
hi, you can use the setfocus function to move to different elements within the form. get a button and set its onselect to SetFocus(DataCardValue1), change DataCardValue1 to your data card names that you want to set the focus to. This button can sit inside and outside of the form, therefore, i would leave it on the outside as then it will always be visible for the user to press, but the choice is yours
Thanks for your response. I think I tried this before and it wouldn't work because I have the controls inside a form. That's why I was trying to target the labels instead.
Hi @jam1977
I created a Scrollable screen and added a lot of Data cards (section) and placed the controls (text, button, label).
For button on select Setfocus(ControlName) to control (with the limitation) in the screen and works.
I know it has lots of limitation but works with Scrollable screen
Thanks, in yours, are the controls within forms in the data cards? That's where I'm having the trouble and am receiving an error. Looking at the documentation, it explicitly says that the controls cannot be within forms.
"You cannot set the focus to controls that are within a Gallery control, Edit form control, or Component . SetFocus can be used with a control in a scrollbale screen."
i have just tested it with a form in FormMode.Edit and FormMode.New with the setfocus button inside the form and outside of the form and it works as expected. the function will not work in a gallery as the element is repeated for each record in the gallery, therefore, setting the focus to textinput1 is not possible as there may be 20 textinput1's in the gallery. SetFocus also works within containers
Thanks, I really appreciate your help. I'm still running into the same error.
I'll attach some screen shots of what I'm doing so maybe you can help me understand why it's working for you but not for me. Should note that I'm not using a gallery.
I'm not sure why you have a form within a data card? i don't think this is a best practise way of doing this. the form should be its own entity really. but the issue here is that you are setting focus to the datacard, this cannot be done, you need to set the focus to the input element within the data card. e.g. textinput1 for example.
Perfect, setting the focus to the DataCardValue worked. As to why I used the data card in the first place. I really don't have a good answer for that. When I was at the end of a particular section with a form, I just clicked on the New Section button at the bottom and that's where I placed the next form for the next bit of content. Thank you for your time and effort!
Under review
Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.
In our never-ending quest to improve we are simplifying the forum hierarchy…
We are honored to recognize Ajay Kumar Gannamaneni as our Community Spotlight for December…
These are the community rock stars!
Stay up to date on forum activity by subscribing.
WarrenBelz 796 Most Valuable Professional
Michael E. Gernaey 327 Super User 2025 Season 2
Power Platform 1919 268