Activity Forums Salesforce® Discussions What is JSON and why we use it in Salesforce?

  • Archit

    Member
    March 27, 2018 at 12:25 pm

    Hello Rahul,

    JSON i.e. JavaScript Object Notation used in exchanging data between a browser and a server, the data can only be text. JSON is text, and we can convert any JavaScript object into JSON, and send JSON to the server. We can also convert any JSON received from the server into JavaScript objects. JSON is light weighted than XML so that we can prefer to choose JSON mostly in place of XML.

    Thanks!

  • PRANAV

    Member
    March 27, 2018 at 12:35 pm

    Hi Rahul,

    JSON (JavaScript Object Notation) is a lightweight format that is used for data interchanging.It is based on a subset of JavaScript language (the way objects are built in JavaScript). As stated in the MDN, some JavaScript is not JSON, and some JSON is not JavaScript.

    An example of where this is used is web services responses. In the 'old' days, web services used XML as their primary data format for transmitting back data, but since JSON appeared (The JSON format is specified in RFC 4627 by Douglas Crockford), it has been the preferred format because it is much more lightweight.

    JSON is built on two structures:

    • A collection of name/value pairs. In various languages, this is realized as an object, record, struct, dictionary, hash table, keyed list, or associative array.
    • An ordered list of values. In most languages, this is realized as an array, vector, list, or sequence.

    For more you can go to json.org

Log In to reply.

Popular Salesforce Blogs

Popular Salesforce Videos