Activity Forums Salesforce® Discussions How can I get value in MAP from JSON in Apex?

  • Aditya

    Member
    July 9, 2020 at 3:54 pm

    Hi,
    Map<String, Object> m = (Map<String, Object>) JSON.deserializeUntyped(jsonInput);
    Map<String, Object> m2 = (Map<String, Object>) m.get('info5');
    List<decimal> d = new List<decimal>();
    for(String s:m2.keyset()) {
    decimal t = (decimal) m2.get(s);
    d.add(t);
    }

  • Pooja

    Member
    July 9, 2020 at 4:39 pm

    Map<String, Object> m = (Map<String, Object>) JSON.deserializeUntyped(jsonInput);
    Map<String, Object> m2 = (Map<String, Object>) m.get('info5');
    List<decimal> d = new List<decimal>();
    for(String s:m2.keyset()) {
    decimal t = (decimal) m2.get(s);
    d.add(t);
    }

Log In to reply.

Popular Salesforce Blogs

Popular Salesforce Videos