0

I have a column called "name" in a list where, if the user enters any space before the name, I have to remove the space and store the name in list. Please provide any formula for this (Javascript is not allowed).

I am currently using SharePoint 2013.

Thanks in advance.

3
  • what language is allowed? c#? when you say store the name, is that on the same list or another list? – Ali Jafer May 29 '14 at 8:08
  • in the same list. I am trying a for excel formula for that. – vinod kumar May 29 '14 at 9:10
  • TRIM() is also not working ... – vinod kumar May 29 '14 at 9:19
0

To store the data back to the field in the list, I guess you would have to use workflow, e.g. when the entry is modified, the workflow starts, trim the leading space of the field, and store it back - and perhaps also send an email to suggest the user not to put space when s/he add new names.

Depends on what kind of workflow you use (e.g. the native one which you create with SharePoint Designer, or 3rd party one like ninetx), there could be different ways.

If the workflow allows regEx, or Trim() function, then the solution would be obvious.

To remove the space before the "name" is saved, and if JavaScript is not allowed, I'm afraid there's limited options available, however, please consider a walk-around, by creating a calculated field, to get the trimmed name from the "name" field, and in the default list view, show this calculated one, instead of the "name".

2
  • while adding a new item to the list or modifying a item, i want to remove the spaces before the name. – vinod kumar May 29 '14 at 9:20
  • @vinodkumar create a calculated field, call it "name", and get the trimmed version from the "originalname" field. – Gao Wei May 29 '14 at 9:25

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.