Skip to main content
Developer Communities Admin
Community Manager
September 15, 2026

IDL Conditional Expressions

  • September 15, 2026
  • 2 replies
  • 14 views

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?

    2 replies

    Developer Communities Admin
    Community Manager
    September 15, 2026

    Originally replied by Pranaw Sharma on Sep 17, 2025, 9:50 AM.

     

    Great tip — this really feels like the standard for complex IDL expressions. IntelliSense makes it easy to find functions, and I often use FindSingle (e.g., to grab the latest record):

     

    find_single(array, (item) => boolean)

     

    Example:

     

    output = find_single([

      { id = "123"; name = "John Doe"; },

      { id = "456"; name = "Jane Doe"; },

      { id = "456"; name = "Nobody"; },

    ], person => person.id == "456");

     

    // => { id = "456"; name = "Jane Doe"; }

    Developer Communities Admin
    Community Manager
    September 15, 2026

    Originally replied by Pranaw Sharma on Sep 25, 2025, 10:16 AM.

     

    More on IDL expression is here in this article: Getting Started with the IDL Expression Library (Search in community)