Logic - do not display if value is empty

In my gridColum, I am displaying an email link, with an envelope-o icon. 

However, if the value of the field is empty or null, it's still displaying the icon.

How do I add the if logic to this code to not display the icon if the value of the field is empty or null? I've edited the code below to shorten the field recordtype! info.

a!richTextDisplayField(
  value: {
    a!richTextItem(
      text: {
        a!richTextIcon(
          icon: "envelope-o"
        ),
        a!localVariables(
          local!fullString: fv!row['recordType!technicalPointOfContact'],
          extract(
            "--beginning--" & " " & local!fullString,
            "g--",
            " <"
          )
        )
      },
      link: a!safeLink(
        uri: "mailto://" & extract(fv!row['recordType!technicalPointOfContact'], "<",">")
      )
    )
  }
)

In addition the following code is throwing "Invalid Syntax errors" 

  link: a!safeLink(
        uri: "mailto://" & extract(fv!row['recordType!technicalPointOfContact'], "<",">")
      ),
   linkStyle: "STANDALONE" <--- invalid syntax???
   )

  Discussion posts and replies are publicly visible

Parents Reply
  • 0
    Certified Lead Developer
    in reply to Yogi Patel

    I would suggest putting the showWhen condition in the RichTextItem object actually - the richTextDisplayField still needs to show up (afaik) so the column has some content, even if it's blank.  additionally my normal trick here would be to add one extra RichTextItem to the displayField's array, set to show ONLY when the email is blank, in which case i show like "(none)" using nice richText formatting also.

Children