I'm getting a JSON response as follows :-

tthis.selectedRecord {"Id":"01t5C000002xxx","Name":"xxxES"},wanted to know how do i get the value of ID & Name separately.

  • 1
    What have you tried? Being that JSON stands for JavaScript Object Notation, and the controller for LWC is, in fact, JavaScript...there shouldn't be any parsing required. Just use it as you would any other JavaScript object...
    – Derek F
    Jun 16, 2019 at 14:12
  • I tried JSON.stringify(this.selectedRecord) - which is giving me the value of ID & Name {"Id":"01t5C000002xxx","Name":"xxxES"}. I want the value of the Id so that i can save this record as a look up.
    – Sunil
    Jun 16, 2019 at 14:49

1 Answer 1


Based on your comment, it sounds like you already have a native JavaScript object; no parsing is required:


Make sure you pay attention to the capitalization of the variables; Name is different than name.


You must log in to answer this question.

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