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
Rushikesh Agnihotri 46Rushikesh Agnihotri 46 

Deserilize the json and get the Name value from technologies node


  "Results": [
    {
      "Result": {
        "IsDB": "True",
        "Spend": 453,
        "Paths": [
          {
            "Technologies": [
              {
                "IsPremium": "no",
                "Name": "SPF",
                "Description": "The Sender Policy Framework is an open standard specifying a technical method to prevent sender address forgery.",
                "Link": "http://www.openspf.org/",
                "Tag": "mx",
                "FirstDetected": 1566774000000,
                "LastDetected": 1629702000000
              }
            ]
          }
        ]
      }
    }
  ]
}
SwethaSwetha (Salesforce Developers) 
HI Rushikesh,
You can use the example listed in  chttps://salesforce.stackexchange.com/questions/174388/how-to-deserialized-json-response-in-apex to get started

Happy to help if you are stuck somewhere

If this information helps, please mark the answer as best. Thank you
Rushikesh Agnihotri 46Rushikesh Agnihotri 46
Hello Swetha,
      I had tried but as it have multiple nodes so not able to get that data
SasidSasid
Hi Rushikesh,

If my understanding is correct, you are trying to get the Name value of the Technologies node using JS.

If yes, PFB - for the same.

        const resultvalue = {
            "Results": [
                {
                    "Result": {
                        "IsDB": "True",
                        "Spend": 453,
                        "Paths": [
                            {
                                "Technologies": [
                                    {
                                        "IsPremium": "no",
                                        "Name": "SPF",
                                        "Description": "The Sender Policy Framework is an open standard specifying a technical method to prevent sender address forgery.",
                                        "Link": "http://www.openspf.org/",
                                        "Tag": "mx",
                                        "FirstDetected": 1566774000000,
                                        "LastDetected": 1629702000000
                                    }
                                ]
                            }
                        ]
                    }
                }
            ]
        };
        console.log('### resultvalue: ', resultvalue);

        resultvalue.Results.find(
            rv => {
                rv.Result.Paths.find(
                    pt => {
                        pt.Technologies.find(
                            tech => {
                                if (tech.Name) {
                                    console.log('### Technologies Name is ', tech.Name);
                                }
                            }
                        );
                    }
                );
            }
        );
Else, you shall use https://www.adminbooster.com/tool/json2apex for JSON to Apex conversion.

    //
    //Generated by AdminBooster
    //

    public class fromJSON{
        public cls_Results[] Results;
        class cls_Results {
            public cls_Result Result;
        }
        class cls_Result {
            public String IsDB;    //True
            public Integer Spend;    //453
            public cls_Paths[] Paths;
        }
        class cls_Paths {
            public cls_Technologies[] Technologies;
        }
        class cls_Technologies {
            public String IsPremium;    //no
            public String Name;    //SPF
            public String Description;    //The Sender Policy Framework is an open standard specifying a technical method to prevent sender address forgery.
            public String Link;    //http://www.openspf.org/
            public String Tag;    //mx
            public Integer FirstDetected;    //1566774000000
            public Integer LastDetected;    //1629702000000
        }
        public static fromJSON parse(String json){
            return (fromJSON) System.JSON.deserialize(json, fromJSON.class);
        }

        static testMethod void testParse() {
            String json=        '{'+
            '            "Results": ['+
            '                {'+
            '                    "Result": {'+
            '                        "IsDB": "True",'+
            '                        "Spend": 453,'+
            '                        "Paths": ['+
            '                            {'+
            '                                "Technologies": ['+
            '                                    {'+
            '                                        "IsPremium": "no",'+
            '                                        "Name": "SPF",'+
            '                                        "Description": "The Sender Policy Framework is an open standard specifying a technical method to prevent sender address forgery.",'+
            '                                        "Link": "http://www.openspf.org/",'+
            '                                        "Tag": "mx",'+
            '                                        "FirstDetected": 1566774000000,'+
            '                                        "LastDetected": 1629702000000'+
            '                                    }'+
            '                                ]'+
            '                            }'+
            '                        ]'+
            '                    }'+
            '                }'+
            '            ]'+
            '        }';
            fromJSON obj = parse(json);
            System.assert(obj != null);
        }
    }

If this helps you, please mark the answer as best.

Best Regards,
Sasid
https://trailblazer.me/id/sasid
Rushikesh Agnihotri 46Rushikesh Agnihotri 46
Hello, Thanks for response. I want to get the Name from technologies node in Apex.I have created the wrapper class and in Apex deserilized the data but don't know how can I get the name from technologies node
SasidSasid
@Rushikesh - Could you please provide your apex code here for reference.