Hi,
I am trying to use Validation logic, but it is not working as expected. Here is my logic condition - User can write '2 Alpha' and '7 digit' hence in total it should be 9 without spaces.
I used this condition -
Solved! Go to Solution.
Views
Replies
Total Likes
Thanks for trying.
To make sure I understand your case correctly, your original problem was that you wanted the field value to have 9 characters, right? The formula you have right now is saying if the field's length is 9 characters, show the error message. Hence, if you type anything expect 9 length words, you will not see the error. If the use case is to allow words with the length of 9, and to not allow everything else, you need to revert the equation sign.
IF(LEN({DE:Global | Global marketing campaign id}) != 9,"Please write '2 Alpha' '7 digit' and 'in total it should be 9' without spaces (eg-tmtpredict)")
Views
Replies
Total Likes
Thanks for reaching out.
Could you please retry with double equation signs?
IF(LEN({DE:Global | Global marketing campaign id}) == 9,"Please write '2 Alpha' '7 digit' and 'in total it should be 9' without spaces (eg-tmtpredict)")
Views
Replies
Total Likes
Thanks for reverting back.
This still not working, I applied a rule not to extend more than 9 words, the error message doesn't come up if I extend the limit. Here is the screenshot.
Views
Replies
Total Likes
Thanks for trying.
To make sure I understand your case correctly, your original problem was that you wanted the field value to have 9 characters, right? The formula you have right now is saying if the field's length is 9 characters, show the error message. Hence, if you type anything expect 9 length words, you will not see the error. If the use case is to allow words with the length of 9, and to not allow everything else, you need to revert the equation sign.
IF(LEN({DE:Global | Global marketing campaign id}) != 9,"Please write '2 Alpha' '7 digit' and 'in total it should be 9' without spaces (eg-tmtpredict)")
Views
Replies
Total Likes
Thank you soo much, this one is working. One more question here, can we also convert this code to allow users to type only 2 Alphabets and only 7 numeric digits not more or less than this condition.
Regards,
Diksha g.
Views
Replies
Total Likes
The following expression should do it
IF(LEN({DE:Global | Global marketing campaign id}) != 9,"Please write '2 Alpha' '7 digit' and 'in total it should be 9' without spaces (eg-tmtpredict)",
IF(CONTAINS(0, LEFT({DE:Global | Global marketing campaign id}, 2)), "Please start with '2 Alpha' without spaces (e.g.-ab)",
IF(CONTAINS(1, LEFT({DE:Global | Global marketing campaign id}, 2)), "Please start with '2 Alpha' without spaces (e.g.-ab)",
IF(CONTAINS(2, LEFT({DE:Global | Global marketing campaign id}, 2)), "Please start with '2 Alpha' without spaces (e.g.-ab)",
IF(CONTAINS(3, LEFT({DE:Global | Global marketing campaign id}, 2)), "Please start with '2 Alpha' without spaces (e.g.-ab)",
IF(CONTAINS(4, LEFT({DE:Global | Global marketing campaign id}, 2)), "Please start with '2 Alpha' without spaces (e.g.-ab)",
IF(CONTAINS(5, LEFT({DE:Global | Global marketing campaign id}, 2)), "Please start with '2 Alpha' without spaces (e.g.-ab)",
IF(CONTAINS(6, LEFT({DE:Global | Global marketing campaign id}, 2)), "Please start with '2 Alpha' without spaces (e.g.-ab)",
IF(CONTAINS(7, LEFT({DE:Global | Global marketing campaign id}, 2)), "Please start with '2 Alpha' without spaces (e.g.-ab)",
IF(CONTAINS(8, LEFT({DE:Global | Global marketing campaign id}, 2)), "Please start with '2 Alpha' without spaces (e.g.-ab)",
IF(CONTAINS(9, LEFT({DE:Global | Global marketing campaign id}, 2)), "Please start with '2 Alpha' without spaces (e.g.-ab)",
IF(LEN(NUMBER(SUBSTR({DE:Global | Global marketing campaign id}, 2))) != 7,"Please end with '7 digit' without spaces (e.g.-1234567)"
))))))))))))
Thank you soo much, it's working fine. 🙂
Regards,
Diksha G.
Views
Replies
Total Likes
One thing that often trips folks up is that validation logic does not work at all in Preview. In order to see your rule work, you have to save your changes and go find that form on a live record.
Views
Replies
Total Likes
Views
Likes
Replies
Views
Likes
Replies
Views
Likes
Replies