-1

I received value from Apex as,

{"data":{"Id":"a002E00000ZKKbGQAX","Name":"FCS Group","Frequency__c":"Monthly",}}

and I want to fetch the value of frequency, Below is the code I tried,

this.strtest=JSON.stringify(data);//outpu is as shown json format console.log('data=='+this.strtest.data);undefined

marked as duplicate by glls, sfdcfox, RedDevil, Raul, Pranay Jaiswal May 12 at 10:44

This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.

3

Im going to repeat myself here:

@Vanaja - I would strongly recommend you go through the LWC documentation:

and to complete the trailheads on LWC's + ramp up your Javascript skills.

this.strtest=JSON.stringify(data);//outpu is as shown json format 

the statement above is not true, JSON.stringify is NOT a JSON object,

console.log('data=='+this.strtest.data);undefined

So, it is normal you cant access it as if it were a JSON object, Strings dont have key values(properties) thus they are not accessible.

Not the answer you're looking for? Browse other questions tagged or ask your own question.