0

Need help in creating a formula to get 'src' value from image url (rich text area) value. Here is the IMAGE url value

(SDLC_Output__c:{IMAGE_SDLC__c=<img alt="User-added image" src="https://pra--PERSONAL11--c.cs16.content.force.com/servlet/rtaImage?eid=aByf00000004CAu&amp;feoid=00Nf0000001Khvs&amp;refid=0EMf0000000D2qU" style="height: 474px; width: 500px;"></img><br>Tetsunjkdjshfbc})
0

As long as your format does not change, you should be able to use the following formula below. Below you'll see that I'm truncating your overall string by 2 attributes, "style" and "src", after this, there is a few additional subtractions which will remove unwanted blank spaces and quotes. That being said, Long text areas are not supported (this also includes rich text area). It will only work with standard text. If you really need this to be on long text areas, you'll need to convert the formula into a trigger.

RIGHT(
    LEFT(
        SDLC_Output__c,
        FIND("style=", SDLC_Output__c) - 3
    ),
    LEN(
        LEFT(
            SDLC_Output__c,
            FIND("style=", SDLC_Output__c) - 3
        )
    ) - FIND("src=", SDLC_Output__c) - 4
)
  • Thanks, it works. I realized it later formula field won't work but Rick Text area field , so now i'm using Process builder and this formula works perfectly – Maverick Oct 3 '16 at 22:32

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.