Forum Discussion
Sharepoint Lists hide white space in values
I was recently trying to compare two value (in power automate) and it said they did not match. But when looking in sharepoint at the list they seemed to match. It turns out one of the fields had an extra space in it. But it's impossible to see that extra space without going in to edit the value. In the list it hides any extra spaces. Even right click>Copy Field to Clipboard copies the modified value, not the actual value. You must click into the field like you are going to change it to see more than one space.
jspengler How are you entering data in SharePoint list, manually typing or copying from somewhere?
There is replace() function in Power automate which you can use to replace multiple white spaces with single white space. Use flow like below to remove all extra spaces between the words, at the start and at the end of the string variable:
Please click Mark as Best Response & Like if my post helped you to solve your issue. This will help others to find the correct solution easily. It also closes the item. If the post was useful in other ways, please consider giving it Like.
For SharePoint/Power Platform blogs, visit: Ganesh Sanap Blogs
- jspenglerCopper Contributor
ganeshsanap This was less about finding a solution and more about documenting the unexpected way that sharepoint works for others benefit.
The data was added to the sharepoint list by some other user, and it was likely a mistake that they entered an extra space. I removed the extra space to correct the issue. It was mostly confusing that the extra space didn't exist in most the ways of viewing the field, like Copy field to Clipboard.
But yes, your power automate flow would be a good way of procedurally suppressing extra spaces as needed. I would probably use it to update the original item to permanently remove the extra spaces.
jspengler This is a kind of behavior/limitation of HTML itself and not just SharePoint. Multiple white spaces between words are shown as single white space in HTML by default.
This can be handled by some custom HTML/CSS. However, you will not be able to add custom CSS to SharePoint modern experience list forms using SharePoint out of the box capabilities.
Check this for more information:
- Text inside div not showing multiple white spaces between words
- Why does HTML require that multiple spaces show up as a single space in the browser?
- Multiple Spaces Between Words in HTML without
Please click Mark as Best Response & Like if my post helped you to solve your issue. This will help others to find the correct solution easily. It also closes the item. If the post was useful in other ways, please consider giving it Like.
For SharePoint/Power Platform blogs, visit: Ganesh Sanap Blogs