Skip to main content
Skip table of contents

Pick-list Value

A Pick-list value is the representation of a value of a Salesforce pick-list field. Besides carrying the selected value, its methods allow the selected value's label to accessed, along with the values and labels of all the pick-list's options.

Related commands

  • record, relatedList& query
    These commands are the producers of Data items, in which Pick-list values may appear in.

Methods

getEntries()

Resolves into a Collection containing values representing all the entries, or options, of the pick-list field this value is from. Each entry value has two properties, value and label, which resolve into Strings telling the entry's API value and label.

For example, if looping through the Collection accessed with ${testValue.getEntries()} and entry being the variable of the currently iterated item, ${entry.value} would resolve into the API value of the pick-list entry.

Using the shorthand form, the expression becomes ${testValue.entries}.

getLabel()

Resolves into a String that is the label of the selected pick-list value. The label is how this pick-list value appears to users in the Salesforce UI.

If the setLabelTranslations command has been used to activate a translation, this method will return the translated label (if the translation contains it).

For example, the expression ${testValue.getLabel()} could return "Test value", or "Testiarvo" if a Finnish translation has been set.

Using the shorthand form, the expression becomes ${testValue.label}.  

getValue()

Resolves into a String that is the API value of the selected pick-list value. If the value appears numeric, and you wish to use it as a Number rather than a String, make use of the set command's parser attribute to convert its type.

For example, the expression ${testValue.getValue()} could return "testValue".

Using the shorthand form, the expression becomes ${testValue.value}. This method is also the default output of the pick-list value, so if being printed onto a document, just ${testValue} would produce "testValue" as well.

JavaScript errors detected

Please note, these errors can depend on your browser setup.

If this problem persists, please contact our support.