Undefined when Passing pre defined Values from lwc to controller

136 views Asked by At

I have called some pre defined from apex controller and passing it down to LWC input value , But while saving the records to another object getting undefined ,else all other values are coming

Defined this Here 
 if (item.Question__r.Question__c === 'Contact email') {
                    isReadOnly = true;
                    selectedInputValue = item.Case__r.SuppliedEmail;
                } 
                if (item.Question__r.Question__c === 'Contact Name') {
                    isReadOnly = true;
                    selectedInputValue = item.Case__r.SuppliedName;
                }

Passing it down from lwc html using handle change

 handleInputChange(event) {
        const responseId = event.target.dataset.responseId;
        const inputValue = event.target.value;
        this.responseMap.set(responseId, inputValue);

        console.log('Response Map:', this.responseMap);

    }

and further Down pushing it down to apex controller

  this.isLoading = true;
            this.validationErrors = {};
            const responseRecords = [];
            this.preparedCasesData.forEach(preparedCase => {
                const responseId = preparedCase.Id;
                const inputValue = this.responseMap.get(responseId);
                const response = {
                    Id: responseId,
                    Question__c: preparedCase.Question__r.Id,
                    Response__c: String(inputValue),
                    Status__c: 'Submitted',
                    Case__c: this.caseId,
                };
                responseRecords.push(response);
            });
0

There are 0 answers