Skip to main content
let jsonFromNet = JSON.stringify(this.conList);

        console.log('stringyfy ==>> ' + jsonFromNet);

       

        let contactObject = JSON.parse(jsonFromNet);

        console.log('parsing ==>> ' + contactObject);

// this avoce console shows [object object]

how to change object to show field Name ??

        console.log('columns----- ' , columns.fieldName);
1 answer
  1. Sep 15, 2022, 11:48 AM
    Hi Sumit,

    List<Contact> conList=[Select id from Contact limit 1];

    //Object to String

    String result=JSON.serialize(conList);

    System.debug(result);

    //String to object

    String js1='{"Name":"Test","Place":"Sangli"}';

    Contact con=(Contact)JSON.deserialize(js1, Contact.class);

    System.debug(con);

      

    Mark, it as the best answer if you find this helpful.

    Thanks,

    Vinayak Karande
0/9000