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
Yogesh Upadhyay 14Yogesh Upadhyay 14 

Lwc return value is [object Object]

Hi everyone can you please help me i am getting object object as return value.


js code :

import { LightningElement, wire, track } from 'lwc';
import mapDemo from '@salesforce/apex/Utility.mapDemo';
export default class LwcUtility extends LightningElement {
    @track name="Yogesh Upadhyay";
    @track message="Welcome";
    @track record;
    @track error;
    @track maps;
    @track conList= [
            name:'One two ka four',
            name:'One two ka five',
            name:'One two ka six',
            this.record = data;
            console.log("return is "+this.record);
            this.error= error;
            console.log("retrun is "+this.error);

apex :
public with sharing class Utility {
    public Utility() {
    public static map<String,Integer> mapDemo(){
        map<String,Integer> testmap = new map<String,Integer>();
        return testmap;


Hello Yogesh,

Try this:

var accData = JSON.stringify(received_data);
var finalData = JSON.parse(accData);



All wire requests have two attributes upon returning: data and error. so you have to use the .data attribute.
So - in your html file use it as  {}

Refer to this link:

Note: Mark it as answer if this resolves your issue.

ekansh parnamiekansh parnami
Try :
var data = JSON.stringify(received_data);
it will resolve your problem