I am trying to make a form with SharePoint using InfoPath 2013 that has a button that changes a text field to the display name of the user editing it at that moment. I tried using userName() but I'm getting i:0#.w|spe\1523233318 as an output instead of the display name. What can I do to solve this?
I too had this claims User Name issue with a people picker.
Try adding another field and grab the value of your UserName() fields with a substring function.
Here's an example:
AccountID is a from the people picker. "0#.w|domain\" is the substring you want to remove.