0

I have a field that contains 4 values that are comma separated: Value1, value2, value3, value4. I am currently able to dissect the first 3 values but am having trouble getting the fourth one. Here is my current first value extraction:

TRIM(LEFT( api_name__c , FIND(",", api_name__c)-1))

Second:

    LEFT(RIGHT( api_name__c , LEN(api_name__c) - FIND (",", api_name__c)), 
    FIND("," , RIGHT(api_name__c, LEN(api_name__c) - FIND (",", api_name__c)))-1)

Third:

   LEFT(RIGHT( api_name__c , LEN(RIGHT(api_name__c, LEN(api_name__c) - FIND (",",
   api_name__c))) - FIND (",", RIGHT(api_name__c, LEN(api_name__c) - FIND (",", 
   api_name__c)))), FIND("," , RIGHT(api_name__c, LEN(RIGHT(api_name__c, 
   LEN(api_name__c) - FIND (",", api_name__c))) - FIND (",", RIGHT(api_name__c,
   LEN(api_name__c) - FIND (",", api_name__c)))))-1)

How can I extract the fourth value?

  • 1
    As I believe the link in your previous iteration of this question indicated, this really is a job better suited for Apex. Must you use a formula here? – Derek F Jul 4 at 15:12
  • Yes, it needs to be a formula – Arthur Anoutchine Jul 4 at 15:31
  • Can you go into more detail about why a formula is required? Also, what have you tried so far to get at the 4th value? (you should edit your question to include what you've tried so far). – Derek F Jul 4 at 16:04
  • 2
    and what happens when requirements change and the business needs 5 (or 6 or more) values split? Formulas are not going to help here and even if you arrive at one, the coding will be opaque to the next admin who inherits this. – cropredy Jul 4 at 18:26
  • There can only be a maximum of 4 values in this field. Here is how you can trim the 4th value: RIGHT( Combination_of_Rated_Skills__c , FIND(",", Combination_of_Rated_Skills__c)-1) – Arthur Anoutchine Jul 8 at 15:27

Your Answer

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

Browse other questions tagged or ask your own question.