For the complete documentation index, see llms.txt. This page is also available as Markdown.

How To: Display Different Values Based on Conditions

Render different cell values based on row-level conditions in lineitemsSOQL.

Use render when each row needs different output based on its own field values.

Problem

You need to show different content in table cells based on field values.

Solution

Basic Conditional Rendering:

<!--{{!
<lineitemsSOQL>
<soql>SELECT Title, Status__c FROM Contact WHERE AccountId = '{{!Account.Id}}'</soql>
<column render="RECORD.Title==null,No Title Available,RECORD.Title"></column>
</lineitemsSOQL>
}}-->

Multiple Conditions:

<column render="RECORD.Status__c == 'Active',✓ Active,RECORD.Status__c == 'Inactive',✗ Inactive,Unknown"></column>

With Formatting:

<column type="rtf" render="RECORD.StageName == 'Closed Won',lt#span style='color:green;'gt#✓ Won lt#/spangt#,RECORD.StageName == 'Closed Lost',lt#span style='color:red;'gt#✗ Lost lt#/spangt#,In Progress"></column>

Result: Won records show in green, lost records show in red, and other records show In Progress.

Nested Conditions:

Important Notes

  • This works only with <lineitemsSOQL>.

  • Include every rendered field in the SOQL query.

  • Do not place a field name between <column></column> tags.

  • Use RECORD.FieldName for the current row.

  • Escape HTML tags with lt# for < and gt# for >.

Pattern Matching

STARTSWITH:

ENDSWITH:

CONTAINS: Use replaceall with regex when you need contains-style matching.

Last updated

Was this helpful?