none
validation rule to enforce comma between first and last name RRS feed

  • Question

  • Hello,

    We have an Employee Name column and we want to ensure that people enter a comma between last name and first name while entering, so basically we want to ensure a comma in between. 

    I have written the following validation rule but it's failing. Can you please advise ?

    [Title]=Regex([A-Z a-z],[A-Z a-z])

    Thank You !

    Friday, August 11, 2017 7:43 AM

Answers

  • Hi,

    Which column type is Employee Name column used?

    If it’s a Person and Group column, it’s not supported to add a comma between last name and first name.

    If it’s a text column, it’s not supported to use regex expression in SharePoint Column Validation.

    In short, there is no OOB way to achieve your requirement. As a workaround, you need to create a custom solution. You can add JS code in NewForm/EditForm to check for the Employee Name column value.

    Thanks,

    Dean Wang


    Please remember to mark the replies as answers if they help.
    If you have feedback for TechNet Subscriber Support, contact tnmff@microsoft.com

    Monday, August 14, 2017 8:14 AM
    Moderator

All replies

  • Hi,

    Which column type is Employee Name column used?

    If it’s a Person and Group column, it’s not supported to add a comma between last name and first name.

    If it’s a text column, it’s not supported to use regex expression in SharePoint Column Validation.

    In short, there is no OOB way to achieve your requirement. As a workaround, you need to create a custom solution. You can add JS code in NewForm/EditForm to check for the Employee Name column value.

    Thanks,

    Dean Wang


    Please remember to mark the replies as answers if they help.
    If you have feedback for TechNet Subscriber Support, contact tnmff@microsoft.com

    Monday, August 14, 2017 8:14 AM
    Moderator
  • Thank You Dean, it was single line of text column. I'm trying with the javascript option. 
    Thursday, August 17, 2017 3:54 PM