1

I have a custom list button on campaign. On select of Campaign records, I need to send the selected Ids to the List type attribute of component. I can do that but when I am iterating over it's ids its taking each character as a list element.

$Lightning.use("c:CampaignDedupApp", function() {

         $Lightning.createComponent("c:CampaignDedupComp",
         {
            CampId : "[701XXXXX90,701XXXXXX12]"

         },

Component

Code

<aura:component controller="CampaignMemberDedupe">
<aura:handler name="init" value="{!this}" action="{!c.myAction}"/>
<aura:attribute name="CampId" type="List" /> 

Output:- [ 7 0 1 x x x x x x ] [ 7 0 1 x x x ]

Unable to get Id as a single element of list.

4
  • Can you show more of your code, sounds like you're iterating over a string, ie looping through characters
    – Aequitas
    Commented Feb 8, 2018 at 5:37
  • I have added my code above where it is iterating over attribute named <aura:attribute name="CampId" type="List" Commented Feb 8, 2018 at 5:50
  • Have you tried with Array as the type instead of List Commented Feb 8, 2018 at 6:11
  • try String[] or Object[] as the type
    – Aequitas
    Commented Feb 8, 2018 at 23:21

1 Answer 1

1

Updated Answer-

$Lightning.use("c:CampaignDedupApp", function() {

     $Lightning.createComponent("c:CampaignDedupComp",
     {
        CampId : ["701XXXXX90","701XXXXXX12"]

     },

Try this

1

You must log in to answer this question.

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