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

ParameterData TypeRequiredDescription
source_object_nameStringYesThe API name of the object to query.
display_field_namesStringYesA comma-separated list of field API names to include as columns in the HTML table.
...matching_field_nameStringYesThe field API name used to filter records.
...matching_field_valueObjectYesThe value to match against the corresponding field.
additional_clause_optionalStringNoAdditional 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:

HTML Table Rendered Example