You need to sign in to do that
Don't have an account?
Parsing specific texts after "."?
Hi,
I am trying to extract text after the last "." used in the value for the text field (External_Product_Name__c) and putting them into formula field (Pure Product Name__c)
So I want to take the text out of this:
SuP.53356.BLACK/BLACK INK.Chrome cool Sleek stylus pen
To this:
Chrome cool Sleek stylus pen
I want to take the last "." into consideration not first or second.
Last time I used something like that for other issue:
However, this is purely based on position of last "." in the text. How can i take last "." into account while building the formula?
Thank you,
Mit
I am trying to extract text after the last "." used in the value for the text field (External_Product_Name__c) and putting them into formula field (Pure Product Name__c)
So I want to take the text out of this:
SuP.53356.BLACK/BLACK INK.Chrome cool Sleek stylus pen
To this:
Chrome cool Sleek stylus pen
I want to take the last "." into consideration not first or second.
Last time I used something like that for other issue:
IF(left(Product_Name__c,2) ='S-',MID(Product_Name__c, 3, LEN(Product_Name__c)), IF(left(Product_Name__c,2) ='RSMPL.',MID(Product_Name__c, 7, LEN(Product_Name__c)), Product_Name__c)))
However, this is purely based on position of last "." in the text. How can i take last "." into account while building the formula?
Thank you,
Mit
https://trailblazers.salesforce.com/answers?id=9063A000000ZlIzQAK
SUBSTITUTE(RIGHT(SUBSTITUTE(Product_Name__c,".","~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~"),50),"~","")
Basically, we'replacing the dots with 50 "~" so to push the last bit to the right as much as possible. Then we take the last 50 characters and remove the "~". It's a bit of a hack, but I assume you'll never have more than 50 characters after the last dot. If you do, just add as manay of those ~ as needed, and change the number 50 accordingly
All Answers
Try it for suggestions.
Kindly let me know if it helps you and close your query by marking it as solved so that it can help others in the future.
Thanks.
@Fincher, I'm trying to find a way, but you may need some code here, since FIND only works left to right, and we never know how many dots you have in your string. I'm trying to come up with something, but not sure I'll get there with a simple formula
last dot from the right - extract text after that
or
first dot from the left? - extract text before that
Just wondering. :)
https://trailblazers.salesforce.com/answers?id=9063A000000ZlIzQAK
SUBSTITUTE(RIGHT(SUBSTITUTE(Product_Name__c,".","~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~"),50),"~","")
Basically, we'replacing the dots with 50 "~" so to push the last bit to the right as much as possible. Then we take the last 50 characters and remove the "~". It's a bit of a hack, but I assume you'll never have more than 50 characters after the last dot. If you do, just add as manay of those ~ as needed, and change the number 50 accordingly
@Fincher, just saw your comment about the textbefore the first dot. That's the easy one, go with:
LEFT(Product_Name__c,FIND(".",Product_Name__c)-1)
Last dot from the right - Keep text whatever comes after that.
or
first dot from the left? - Keep text whatever comes before that.
(Either one should do)
Like in this one : SuP.53356.BLACK/BLACK INK.Chrome cool Sleek stylus pen
LEFT(Product_Name__c,FIND(".",Product_Name__c)-1)
Will give you "SuP"
SUBSTITUTE(RIGHT(SUBSTITUTE(Product_Name__c,".","~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~"),50),"~","")
Will give you "Chrome cool Sleek stylus pen"
SUBSTITUTE(RIGHT(SUBSTITUTE(Product_Name__c,".","~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~"),50),"~","")
Only problem is that dots are other places too. But 90% it working where dots are at correct place to cut the string.
Sorry it cannot get better than that. I am pitching to make it more streamlines from the data-source side now.
Thanks.
When there is more than one in the Product name, it works, only the latest text is returned (I tested). Am I missing something?
Where you can see that position of the dot is not exactly before the full product name. So, in the above example Black.Nozzletip Water Bottle and Silk.Autumn Cozy Scarf is getting parsed as Nozzletip Water Bottle and Autumn Cozy Scarf
So the formula works and is awesome. Its too bad that I cannot rely on the parsing formula in this case. :(
Maybe if the full naming standardization is reached from the source system.