function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
Chandramohan Yetukuri 1Chandramohan Yetukuri 1 

Hello i am not able to pass a list of strings from lwc to apex. Getting the error: "message":"Value provided is invalid for action parameter 'testList' of type 'LIST'"

    var OPTION1 =  this.template.querySelector("lightning-datatable[data-myid=dt6]").getSelectedRows();

    var OPTION2  = JSON.stringify(OPTION1);

Calling Apex Method:        
       
callNext({
        stringList : OPTION1 or OPTION2
        })  



    *********************************************
    ***ERROR MESSAGE I AM GETTING********
    *********************************************
        
    "message":"Value provided is invalid for action parameter 'stringList ' of type 'LIST'"
Jalagam KumarJalagam Kumar
Hi Chandramohan, try giving like this

@track Option1=[];
this.Option1.push(this.template.querySelector("lightning-datatable[data-myid=dt6]").getSelectedRows());
callNext({
        stringList : this.Option1,
        })