Discussions
Step-By-Step Guide To Extract Month From Birthday Date using Contact Washing Machine App and RegEx E

Let's say you collect Birthdays of your customers in format Year-Month-Date and you wish to isolate the "Month" in another contact field called "Month" for some custom emails to be sent month-wise. Below is the step-by-step guide to extract just Month from Birthday (Format: Year-Month-Date) using Contact Washing Machine and RegEx, please be mindful of testing the CWM configuration in sandbox first.
- Create a contact field named – MONTH per say in your instance.
- Drag and drop Contact Washing Machine(CWM) app in a new Campaign from action bar
- Double click on CWM app and click on pencil icon.
- Enter below steps on Configuration window. Please Select, Step name, Source Field as your date of "Birthday" (Format: Year-Month-Date) contact field, “RegEx Extract” under Action Item and enter code “[-.\/](\d+)[-.\/]” and Destination field as "Month" in this case.
5. Hit Save.
6. Your configuration is saved; now test it via hourglass icon given at the top of the CWM configuration window. Add email addresses via”+” sign and hit “Run Test” to test your configuration. See in below snapshot - you will notice "Input Value as Birthday date" as Birthday - 2015(Year)-04(Month)-01(Date) and "Output Value as only Month" as "04".
Hope this will be helpful. Do let me know in case of any questions.
** Need more information on Contact Washing Machine App? Click below Oracle Help Centre doc on what is Contact Washing Machine app, how to download/install it and it’s actions - https://docs.oracle.com/cloud/latest/marketingcs_gs/OMCAA/Help/Apps/ContactWashingMachine/Tasks/InstallingContactWashingMachine.htm?Highlight=contact%20washing%20machine
Comments
-
Question - what field type should 'Month' be?
I have the original date as a date/time field and 'Month' as a text, CWM giving me a 'Error! Field mappings were incorrect' message.
-
Question - what field type should 'Month' be?
I have the original date as a date/time field and 'Month' as a text, CWM giving me a 'Error! Field mappings were incorrect' message.
Hi Nathan,
Try using Date as Field Type = TextBox and Output format type as MMMM,d. Month = TextBox. See below snapshots and let me know if that is helpful.
This is the date and time format in my test database.
This is the Date and Time field view under Fields and view:
-
Question - How can I extract the year?
What should I write in the regular expression section?