IDL Conditional Expressions
Originally posted by Sukal Mondal on Edited September 17, 2025 at 9:24 AM.
IDL Conditional Expressions
Problem:
A developer was trying to write an IDL expression to pull an email address if it exists, otherwise fall back to the first letter of the first name + last name. Their code looked like this:
if is_material(find_single(contacttype="Business")) && emailadd ! nil {
emailadd
} else {
string_concat(string_left(firstname,1),replace(lastname," ",""))
}
…but it didn’t work as expected.
💡 Expert Tip:
When learning IDL, it often helps to build your logic in the front end first. Once it works, click View IDL to see how the system generates the expression. You can then tweak and expand that logic directly in IDL.
👉 Have you written similar conditional expressions? Do you usually start in the front end or go straight into IDL?
Any favorite “gotchas” or shortcuts you’ve picked up along the way?
