You need to sign in to do that
Don't have an account?

Formating HTML through the Salesforce API
We are using the Salesforce Api to order to create new contacts on Salesforce and one of the field is a rich-text and is able to receive HTML We are trying to format this field as a list as in the following example:
Any idea how could I keep the desired HTML format?
{ "country": "Algeria", "description": "<<ul><li>Description: Broker</li><li>Additional Notes: Hi how are you</li><li>Property Name: none</li><li>Property Address: none</li><li>City: None</li><li>Current Use: Land</li><li>Interested In: Renting the property</li><li>Asking Price: 500</li><li>Currency: AWG</li></ul>", "email": "jojojo@gmail.com", "firstName": "Johnnny", "lastName": "Doee", "web_to_lead": true }The contact is well sent to salesforce but the description instead of being displayed that way:
- Description: Broker
- Additional Notes: Hi how are you
- Property Name: none
- Property Address: none
- City: None
- Current Use: Land
- Interested In: Renting the property
- Asking Price: 500
- Currency: AWG
Any idea how could I keep the desired HTML format?
To display the rich-text field in the desired format with HTML list tags, you need to use the Salesforce field's "rendered" attribute. This attribute allows you to specify whether to display the field's value with the rendered HTML tags or as plain text.
Here's an example of how to use the "rendered" attribute in SOQL to retrieve the contact record with the desired HTML format:
Note that we added ".rendered" to the Description__c field to indicate that we want to retrieve the field's rendered value with HTML tags. This will give you the desired output with the HTML list tags.
If you're creating a new contact record, you can include the ".rendered" attribute in the rich-text field value as well. Here's an example of how to do that in Apex:
Hope it helps !
Thank you.