HTML_TABLE
Description
Generates a formatted HTML table string from records of the specified source object, filtered by matching field-value pairs and an optional query clause.
Syntax
HTML_TABLE(source_object_name, display_field_names, ...[matching_field_name, matching_field_value], additional_clause_optional) -> String
Parameters
| Parameter | Data Type | Required | Description |
|---|---|---|---|
| source_object_name | String | Yes | The API name of the object to query. |
| display_field_names | String | Yes | A comma-separated list of field API names to include as columns in the HTML table. |
| ...matching_field_name | String | Yes | The field API name used to filter records. |
| ...matching_field_value | Object | Yes | The value to match against the corresponding field. |
| additional_clause_optional | String | No | Additional query conditions for more precise filtering. |
Example
HTML_TABLE(
"Opportunity",
"Name, Amount, StageName, CloseDate",
"AccountId", Id,
"Amount > 5000 ORDER BY CloseDate DESC"
)
-- Returns an HTML table string of Opportunity records related to the Account, filtered by Amount and sorted by CloseDate.Rendered table example:
