SAP Knowledge Base Article - Public

2913809 - How to use Business Rules to Validate Only Field Value Format - Recruiting Management


  • This article describes how to use Business Rules in Recruiting to validate if a field value is only Digits, Letters or Alphanumeric.
  • Besides checking the value, you can clear out the value entered and ask the user or the candidate to fill it again until the correct format is entered. These instructions are also provided in this article.
  • This rule will only be executed on the UI.
  • Notice that the article intends to show the Business Rule feature capability and let the users be more familiar with the tool. The rule described can have different behaviors on different system. Please reach out to your Implementation Team and/or Partner for implement the same if you are having any issues with it.

Image/data in this KBA is from SAP internal systems, sample data, or demo systems. Any resemblance to real data is purely coincidental.


SAP SuccessFactors Recruiting Management - All Versions

  • Business Rules in Recruiting


Rules to validate field value format:

  • Candidate Profile and Job Application rules are not supported when Mobile Apply is enabled. Business Rules for Mobile Apply are on road map and will be enhanced on further releases (2866437 & 2781775).
  • The same rule structure can be applied to Job Requisition, Candidate Profile, Job Application and Offer Letter. Please, make sure to select the correct template while creating the rule.
  • When selecting a template, you will only be able to work within the selected scenario. For example, if you create a Candidate Profile rule and you want to have the same on the Job Application, you must create a Job Application rule as well.
  • A validation will make more sense to the user or the candidate if the rule brings a message or a warning after the execution. Please refer to the end of the article on how to create a message in Manage Data. OnSave trigger event does not support raise message function.

Each validation will require a specific regular expression. Please refer to the below expression:

Only digits from 0-9:   ^[0-9]+$

Only alphabet letters:   ^[a-zA-Z]+$

Only upper/lowercase alphabet letters:   ^[A-Z]+$  OR  ^[a-z]+$

Only alphanumeric:  ^[a-zA-Z0-9]+$

If you want to include space ( ) in the above validations, you need to include a space, a non-breaking space, after the last value, as the following example (Notice the space after the number 9):

Without Space:   ^[a-zA-Z0-9]+$

With Space:        ^[a-zA-Z0-9 ]+$

To validate any format above with a specific length, you will be using the following expression. You can change the length limit to any number.

Only digits with a length of 1-20:   \d{1,20}

Only alphabet letters with a length of 20:   [a-zA-Z]\{20\}

Only alphanumeric with a length of 20:   [a-zA-Z0-9]\{20\}

Sample Case: Validating a field to receive only alphabet letters and spaces.

Base Object: Candidate Profile

Trigger Event: OnChange

Steps to create the rule:

  1. Go to Configure Business Rules and click Create New Rule.
  2. Select Recruiting option and choose Configure Business Rules on Candidate Profile.
  3. Type the Rule Name and Rule ID.
  4. You can leave the Start Date as it is.
  5. Description if desired.
  6. Click Continue

  7. On "IF" parameter, set the field which you to do the validation. Then select "Is not equal to" and "Null". This is required to ensure that the rule will not be triggered in case the field is empty.
  8. Now you need to add another condition. For that, open the dropdown, open Add and select the Parent Add option.

  9. After adding a new condition, click o the "+".
  10. On the first dropdown, select Matches() option. On the right side of the box, select "Is Equal To" > "Boolean" > "No".
  11. String to be Checked: The field where the validation will occur. Same as the first condition.
  12. Regular Expression: ^[a-zA-Z ]+$
  13. Above expression will be for entering only alphabetic letters and spaces. You can use any expression provided listed above.

  14. On "THEN" parameter, set the first option to "Raise Message".
  15. On "Message" select the message you want to throw it. For more information on how to create message, please refer to the article  2610536 - RCM Business Rules: Raise Message
  16. You can choose any severity type.

    The next steps will instruct you to use the rule to also clear the information from the field if the value entered is invalid. This will force the candidate/user to enter the correct value. It's important to make it clear on the message which are the correct values. In case you don't want to have this scenario, you can move to step 19.

  17. Click on "Add Expression" on the right side of the rule.

  18. Then on the first option, select "Set" the field where the validation will occur (Same as above steps), select "To be Equal to" and "Null". This will make the rule to turn the field value into "Null" after the message is raised, therefore every time a wrong value is entered, the field will be automatically cleared. 
  19. Save the rule.
  20. You will be able to modify it anytime.
  21. Go to Manage Rules in Recruiting.
  22. On Candidate section, on Field Change Rules (onChange event type), select the field and the rule.

  23. Save the changes.

See Also

2610536 - RCM Business Rules: Raise Message

2866437 - Business Rules on Job Application are not triggering - Recruiting Management

2781775 - Business rules are not getting triggered for Candidate Profile - Recruiting Management

2618607 - Manage Rules in Recruiting Management

2704222 - Business Rules Are Not Being Saved - Recruiting Management

2913572 - How to use Business Rules to Convert a String Value To Upper/Lowercase - Recruiting Management

2919193 - How to use Business Rules to Validade Candidate Age - Recruiting Management

2921494 - How to Use Business Rules to Disqualify a Candidate Based on Field Values (Pre-Screening) - RCM

2914208 - How to use Business Rules to Validate Field Value Format with Special Characters and Length - RCM


Business Rules; Rule; Recruiting; RCM; Validation; Regular Expression; Only Letters; Check; Field; Value; , KBA , LOD-SF-RCM-RUL , Recruiting Rule Issues with MDF Platform , How To


SAP SuccessFactors Recruiting all versions


Pasted image.png