I have a field with string /IN/TG/HYD/ where i need to split IN into one field and rest all into other using salesforce formula field

I have written using mid function but the last special character is not omitting


Desired result F1 = IN,F2 = TG/HYD

  • please provide desired result in the format: field1= IN, field 2 = TG/HYD Dec 3, 2021 at 9:38

1 Answer 1


Please check this... You need to have 2 formula fields; Assuming that you could rely on the format , here are the values of the formula you would want to use:

Formula 1: (testFormula_Country) : Mid( CountryCityStateValue__c , find("/",CountryCityStateValue__c ,1)+1, find("/",CountryCityStateValue__c ,2) - find("/",CountryCityStateValue__c ,1) - 1 )

Formula 2: (testFormula_CityState) : Mid(CountryCityStateValue__c , find("/",CountryCityStateValue__c ,2)+1, len(CountryCityStateValue__c ) - find("/",CountryCityStateValue__c ,2) - 1 )

CountryCityStateValue__c field contains the combined value enter image description here Attached is the screenshot, where the results are displayed on the page.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.