3

I'm using Custom Labels in a component. I'd like to make one of my labels, myCustomLabel_Heading, optional; you can add it if you like, but it's not required as part of the content.

When I go to edit myCustomLabel_Heading in Custom Labels, Salesforce tells me that the label value is required. Is there a way to save a Custom Label so the value is empty?

I'm using aura:unescapedHtml to render the Custom Labels. Using a   as the value of myCustomLabel_Heading renders an empty space. Ideally I'd like nothing rendered at all (no value in my Custom Label).

1
  • Value of custom label is required, you could add an aura:if condition before the unescapedHtml to hide if the label contains the default value. Seems like you want to achieve the functionality provided by design parameters, is this component not exposed to app builder?
    – Raul
    Commented Jun 30, 2020 at 23:10

1 Answer 1

4

On occasions where I've needed this, I've always just set it to the Zero Width Space (U+200B). Amazingly, Salesforce supports this as a valid character to save, and it has no width (exactly 0 pixels). You can copy it from "​", although it may be hard to grab. You can also copy it from this page, which is how I copied it (there's an input field you can copy from, just click in it, Ctrl-A, Ctrl-C, and then Ctrl-V into Salesforce). Alternatively, since you're using unescaped HTML, ​ may also serve your use case.

0

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .