Showing results for 
Search instead for 
Did you mean: 

Enable Set Focus in Gallery items

Currently the SetFocus function does not work in Gallery items.  This would be really useful if we could.

We are seeing a lot of development that uses in line editing in a gallery (to simulate the repeating tables we used to use in infopath).  When error proofing/patching is added to the OnChange property of these fields, they lose focus.  We would like to be able to SetFocus for a better user experience of tabbing between fields.

Status: New
Regular Visitor

To add on to this, it would be extremely useful to be able to use SetFocus with controls on an EditForm in a customized SharePoint form.

The out-of-the-box SharePoint Online forms have this functionality, but we cannot achieve it in custom forms with PowerApps yet, with no explanation as to why.

Frequent Visitor

+1. useful for working with large galleries to programmatically set the focus back to the first item.

Frequent Visitor

Set Focus is a great tool, but it has way to much limitations. It would be nice if we can set focus in editform & gallerys.

Not applicable

YES... AND... why not leave the focus alone upon "OnChange" event...

Patch('sharepoint list',ThisItem, {SP_Field: Self.Selected.val});

Regular Visitor

I checked this functionality today in SharePoint integrated New/Edit forms by adding SetFocus in OnVisible property of FormScreen and seems like this is working, but as per Microsoft documentation this is not yet supported in EditForms. Can someone confirm this?

Super User

This is needed for galleries. I want to be able to patch to a gallery OnChange without the text input losing focus

Regular Visitor

This might be too late as someone else may have a solution but this is my crack at it:


I have a possible workaround for this issue.  I want the focus to start at the first field in my new record screen.  I was unable to use SetFocus on the DataCardValue. 


My solution is to create a text input box and size it to fit directly over the DataCardValue field in my form.  I then set the focus to that text input box when I enter the form.  The default value of the DataCardValue becomes value typed into the text input box.  The record submits to SharePoint as expected.  I verified by searching for my entered record and all expected data is returned normally.