5

This Configuration File Tags documentation talks about list support for the type value:

The attribute’s data type. To specify a list, add array notation [] to the end of any data type. These values are valid for all targets:

Boolean
Integer
String

but for e.g. this:

<targetConfigs>
    <targetConfig targets="lightning__RecordPage">
        <property
            name="PerSlot"
            label="Per slot array"
            type="String[]"
            default="abc, def, ghi"
            required="true"
        />
    </targetConfig>
</targetConfigs>

I get this error reported (whatever apiVersion I use):

The attribute type 'String[]' is not supported by one or more of these targets 'lightning__RecordPage'

and removing the [] fixes the problem.

Can this list format be made to work?

PS

Here is a screenshot of the documentation:

documentation screenshot

5
  • Seems like the documentation has hidden clause: These values are valid only if the target is lightning__FlowScreen.
    – Raul
    Commented Dec 27, 2019 at 13:22
  • @Raul I think that piece in documentation speaks about the Apex Class/Date/DateTime/ObjectName. But looking at the docs it seems Boolean, String, Integer and array type are all valid types for any target.
    – Jayant Das
    Commented Dec 27, 2019 at 13:28
  • @JayantDas the documentation doesn't seem to be correctly written, Same code works for lightning__FlowScreen: targetConfig targets="lightning__FlowScreen"
    – Raul
    Commented Dec 27, 2019 at 13:33
  • 1
    @Keith, could you please specify on what you want to achive. If you want to have a picklist as a option? for that instead of default you could try datasource.
    – Raul
    Commented Dec 27, 2019 at 13:36
  • 1
    @Raul It does seem that docs are missing some piece of information
    – Jayant Das
    Commented Dec 27, 2019 at 13:36

2 Answers 2

6

The documentation itself mentions that:

These values are valid only if the target is lightning__FlowScreen.

5
  • 1
    I think that piece in documentation speaks about the Apex Class/Date/DateTime/ObjectName. But looking at the docs it seems Boolean, String, Integer and array type are all valid types for any target.
    – Jayant Das
    Commented Dec 27, 2019 at 13:28
  • I feel like maybe the line that mentions lists should be below the types list and right before the "these values are valid only..." sentence. I don't think it makes sense to allow a list of parameters in a component configuration outside Flow. On record pages you can't specify lists anyway, but on Flows you can reference flow list variables. Commented Dec 27, 2019 at 13:32
  • Honestly I am not sure because haven't tried for myself. But it does seem that there is some missing statement in the docs.
    – Jayant Das
    Commented Dec 27, 2019 at 13:33
  • 1
    I took that sentence to relate to the following text where more complex types are discussed.
    – Keith C
    Commented Dec 27, 2019 at 13:41
  • This sentence ends in a ., not a :, so I assume it is referencing the information above it (the basic boolean, integer and string types). But, since list of data doesn't really make sense outside flow, I assume that lists are valid only if you are using the Flow Screen target. This text could be improved. Commented Dec 27, 2019 at 13:46
0

you should use datasource attribute for property:

<property label="Status" name="status" type="String" datasource="Active, Locked" default="Active"/>
2
  • I believe the question is asking about assigning a list to the property and not just a single string.
    – nbrown
    Commented Nov 15, 2021 at 20:29
  • 1
    Seems that List type is not available anymore, so there’s no option to setup multi-select type Commented Nov 16, 2021 at 21:26

You must log in to answer this question.

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