I think that I discovered a bug in the Power Apps for Teams port.
In Power Apps for Teams you have a "Text box" input that behaves like you would expect. However, this input control has a different name in the Power Apps web experience. On the web, a text input control is call "Text Input".
This change causes issues when you try to use the SetFocus function, as "Text box" is technically not part of the available controls for SetFocus.
Continueing on this difference in Power Apps for Teams, I think it is unwise to have different naming for the same control on different platforms, as it can cause confusion by trying to follow the documentation on MS Docs, or any other tutorial that mentions the TextInput control (which cannot be found in Power Apps for Teams...).
I have a feeling SetFocus() might not be working at all in Dataverse for Teams, with any of the Fluent Controls.
I've tried labels/text, both inside of scrolling screens, inside forms, and just on the screen;
I cannot get the SetFocus() function to work with any of them 😞
Works fine in ordinary Canvas Power Apps, just not in Power Apps for Teams.
"Continuing on this difference in Power Apps for Teams, I think it is unwise to have different naming for the same control on different platforms"
Don't stress too much about this, Microsoft is in the process of converging the Canvas Power App Maker / Model-Driven App Maker (and presumably the Teams Apps Maker), into a single App Maker experience.
i assume the intention, is that we will be using Fluent controls in the future.
There wont be a difference in the future.
so what work around can you do now?
- create a Canvas App
- insert a Text Control
- copy that Text Control
- create a Power Apps for Teams App
- paste the Text Control from the Canvas App into the Power Apps for Teams App
so cool that you can do this 😄
serious warning time.. not sure if this is a good idea to do this.. probably-definitely not supported, and may break in future
This is still the issue. I changed my app strategy (which was constructed with layout containers for responsiveness) to redo it without the containers but still the issue is lingering. Now @Cam, the copy from canvas app of text box is also not working; not that I tried it before but going with your work-around. I am unable to copy/paste text box between the two. I hope they fix it really soon.
Yes this doesn't work for me either, any other work around to use setfocus in Powerapps for Teams? All I want to do is setfocus on a text box in order for it to receive scanned RFID ID card info 😞
Keep up to date with current events and community announcements in the Power Apps community.
A great place where you can stay up to date with community calls and interact with the speakers.
Check out the latest Community Blog from the community!