function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
thekid12345thekid12345 

Workflow Formula to Parse Comments Section on Task Object

I am trying to create a workflow formula that parses the Comments section on a Task. Comments on the Task object will always have 'Dialed: (999)925 - 1234'. I want to extract (999)999 - 1234 and have that map to another custom field I have on the task object.
So far I have: IF(Comments(Contains('Dialed'(
not sure if this is the right way to go about this.
Deepak GulianDeepak Gulian

This simple formula will return you only (999)925 - 1234

Formua: RIGHT('Comment_Field', 15)

Comment_Field = Dialed: (999)925 - 1234

I'm not sure if you are asking for this let me know if it works.

thekid12345thekid12345
So basically, when you create a new task, there is a Comments section where people can write notes.  I want to parse this section.  If someone writes Dialed: (999)999 - 9999, I want to take (999)999 - 9999 and map this to another field on the task record.  My reasoning was that somehow I need to first check if the Comments Section has the word Dialed in it, if it does then grab (999)999 - 9999 and map it to another task field.  I was thinking along the lines of IF(Contains(Comments, "Dialed: ").  Not sure what to do next
Deepak GulianDeepak Gulian

But are you sure about that people going to write comment like this "This is a testing comment. Dialed (999)999 - 9999. Please Ignore" . Will there be a case where they can write only number or they can add number in a different format 

(999) 999 - 9999.

thekid12345thekid12345
The format will always be: Dialed: (999)999 - 9999
thekid12345thekid12345
There can be text before, after, or before and after.
Deepak GulianDeepak Gulian

SUBSTITUTE(  IF( CONTAINS(Comment_Field,'Dialed' ),  MID( Comment_Field, FIND( 'Dialed', Comment_Field), 23 ) ,''), 'Dialed: ', '')

Try this!

thekid12345thekid12345
Alrite I will give it a Try, Thank You
thekid12345thekid12345
So I think I wouldn't want to use substitute, I want to grab that number and map it to another field I have on the task
Deepak GulianDeepak Gulian

IF( CONTAINS(Comment_Field,'Dialed'), SUBSTITUTE( MID( Comment_Field, FIND( 'Dialed', Comment_Field ), 23 ), 'Dialed: ', ''),'') 

If you want to populate this field may be you should use process builder and put this formula to populate the phone number in specific field.

thekid12345thekid12345
I was suggested to use a Workflow Formula 
Deepak GulianDeepak Gulian

Please find attach a screenshot using workflow rule and replace the "Field to update" = Your Custom Field

User-added image

thekid12345thekid12345
is this in workflow rules?
thekid12345thekid12345
Got it let me test thank you for your help
thekid12345thekid12345
Hi Deepak, it is not updating the field with the phone number still :(
Deepak GulianDeepak Gulian
Can you please share the screenshot of your workflow rule ?
thekid12345thekid12345
User-added image
Deepak GulianDeepak Gulian
Show me the image of Workflow rule screen also, this is action screen.
thekid12345thekid12345
User-added image
Deepak GulianDeepak Gulian

User-added image

Please change you rule like the above screenshot and then try and make sure your workflow rule is activw.

thekid12345thekid12345
User-added imageUser-added image
thekid12345thekid12345
not working still don't know why
Deepak GulianDeepak Gulian
Can you call me on skype deepak.gulian32 
thekid12345thekid12345
I can't at the moment
Deepak GulianDeepak Gulian
I just tried this simillar workflow rule and its working completely fine at my end. So I need to see your screen to figure it out.
thekid12345thekid12345
yea that's weird