Why is my validation function using "contains" not finding an error with 'John test' but it does find an error with 'test'?

Question

The following data validation function uses the "contains" operator.  If I apply 'test' in the value of FirstName, it works as expected.  If I apply a 'John test' in the value of FirstName, it does not work as expected.

mceclip0.png

 

The data validation function (contains(attributes.FirstName.value, 'test')) in the UI which contains the following payload

[{"type":"UPDATE_ATTRIBUTE","uri":"entities/1HM9suJS/attributes/FirstName/3UoUzRfTH","newValue":{"value":"John test"},"crosswalk":{"type":"configuration/sources/Reltio","value":"1HM9suJS"}}]
  • Request Payload
[{"type":"UPDATE_ATTRIBUTE","uri":"entities/1HM9suJS/attributes/FirstName/3UoUzRfTH","newValue":{"value":"test"},"crosswalk":{"type":"configuration/sources/Reltio","value":"1HM9suJS"}}]

  • Response Payload
[{"errorType":"INCORRECT","severity":"ERROR","objectUri":null,"objectTypeUri":"configuration/entityTypes/HCP/attributes/FirstName","objectParentUri":null,"message":"First name contains \"test\""}]

 

Answer

To take into account both "test" and "John test".  You need to define the validation expression as  

"expression": "contains(attributes.FirstName.value, '*test*')"

 

Was this article helpful?
0 out of 0 found this helpful

Comments

0 comments

Please sign in to leave a comment.