The Objective of this article is to share how can a developer extract the image from the Richtext field on any object using REST API
How to do it
There are 4steps to it
- Create an object / use any existing one e.g say Knowledge standard object
- Create a new RichText type field named Details
- Get ready with your Postman and call the GET sObject request
- endpoint :/services/data/v55.0/sobjects/knowledge__kav/ka15e0000011oBYAAY (where “ka15e0000011oBYAAY” is my record Id)
- response: FAQ_Answer__c”: “<img alt=\”Screenshot 2022–08–09 at 14.15.51.png\” src=\”https://mohitchhab-20210713-demo--c.documentforce.com/servlet/rtaImage?eid=ka15e0000011oBY&feoid=00N5e00000TbmXY&refid=0EM5e000001q21x\"></img>"
4. copy the “ref Id” from the response from the respective richtext field shown in the response and prepare to make another Get call to the following resource :
- GET: /services/data/v55.0/sobjects/knowledge__kav/ka15e0000011oBYAAY/richTextImageFields/FAQ_Answer__c/0EM5e000001q21x
Have you come across this common business ask to setup case hierarchy? if yes follow along →
2 quick options for you
- Setup case hierarchy using standard, ‘parent Case’ field and related cases related list to display all related cases on a parent level. Also you can use the Case hierarch button available in lightning UI to visually see the hierachy.
2. In case, the standard UI doesn’t fit well and you would see a need for customization, WAIT!! , prior jumping to development check this utility on appexchange, if it helps→ Any record Hierarchy by Salesforce labs: https://appexchange.salesforce.com/appxListingDetail?listingId=a0N3u00000MBe9WEAT