I have a free text field (Say 'Comment') which contains lot of information. I want to create a new field based on 3 conditions.
1. If the field 'comment' contains value 'Pay', I want the new field to be created with pay and following 10 letters.
2. If the field contains 'nopay' or 'donotpay', I want the field to be updated with nopay and donotpay respectively.
3. If the above three keywords are not found, I want the new field to be updated with 'check'.
Example:
Comment | New field output |
Transaction 4584838790 pay3546779890 Coded 758u498 | pay3546779890 |
Large item 4584838790 nopay Name 758u498 | nopay |
Small item 45848387976 donotpay Mandy 758u498 | donotpay |
Medium size carrot gold finger 86482928749 | check |
Solved! Go to Solution.
Hi @pranee_007 ,
Try this workflow.
You can modify the regex if you definitely only need it to capture 10 digits after the 'pay' text, but I set it to capture anything between 5 and 10 digits.
Hope this helps.
Hello @pranee_007 ,
A formula tool with the following worked for me:
IF Contains([Comment], 'donotpay') THEN 'donotpay'
ELSEIF Contains([Comment], 'nopay') THEN 'nopay'
ELSEIF Contains([Comment], ' pay') THEN REGEX_Replace([Comment], '(.*)(\s)(pay)(.{10})(.*)', '$3$4')
ELSE 'check'
ENDIF
Regards
Hi Dazzerman,
The solution you provided works well. But, how to make it case insensitive?
Even if someone provides comment as NoPay, how will it recognize?
Hello @pranee_007 ,
The solution for that would be to edit the comment to be lowercase first
Regards