Hi There - I'm hoping someone can provide some guidance.
I launched an app in mid-May that has a timesheet functionality that allows users to log time against tasks on projects. The timesheet captures the logged in user behind the scenes using User().FullName and writes that to the EmpName field (which is single line of text field) in my SharePoint list.
Initially everything worked fine, but recently users have been reporting that their time is not saving properly. I have been tearing my hair out trying to figure out what's happening. This morning I finally discovered that sometimes User().FullName is returning FirstName LastName and sometimes it is returning LastName, FirstName.
So when users return to their timesheet to add more hours, some hours aren't showing. The timesheet is just a Gallery of items with a filter that says show me the entries for the selected timesheet week where EmpName=User().FullName. So depending on how PowerApps decides to recognize the user at that exact point in time (i.e, at that moment are they seen as FirstName LastName or LastName, FirstName), there are missing records when the data was stored the opposite way.
I am not finding any patterns as to why, how or when this is happening. It is not happening to all users and not happening to any particular user and for those it has happened to, it is not even consistent. They can enter hours as FirstName LastName and then return an hour later and this time is saves their name as LastName, FirstName.
I've searched the community and I can see that others have encountered the same issue. I found a suggestion to use Office365Users.MyProfile().GivenName & " " & Office365Users.MyProfile().Surname instead of User().FullName. This would require a significant level of effort to update my app at this point and I'm not certain this will even solve the issue.
I was hoping someone might be able to provide some insight and guidance on the best approach to make this work consistently and reliably every time. Any help or insight is greatly appreciated...thank you, in advance!