Activity Forums Salesforce® Discussions How to use map inside a map in the json deserializeUntype in Salesforce without using class?

  • Nikita

    Member
    November 22, 2019 at 6:53 am

    Hi Piyush,

    deserializeUntype is used to Deserializes the specified JSON string into collections of primitive data types. To use map inside a map in the json deserializeUntype in salesforce without using class, you can refer https://developer.salesforce.com/docs/atlas.en-us.apexcode.meta/apexcode/apex_class_System_Json.htm#apex_System_Json_deserializeUntyped

  • Yogesh

    Member
    November 22, 2019 at 7:43 am

    Hello,

    try this code below:-

    {
    "application_results": {
    "permitted_deposit_sources": {
    "@type": "AllowedValuesTestResult",
    "result": "PASS",
    "supplied_value": [
    "SAVINGS",
    "GIFT"
    ],
    "test": "[?] in [SAVINGS, GIFT]"
    },
    "use_of_funds": {
    "@type": "AllowedValuesTestResult",
    "result": "PASS",
    "supplied_value": [
    "PURCHASE"
    ],
    "test": "[?] in [PURCHASE]"
    },
    "maximum_number_applicants": {
    "@type": "NumericTestResult",
    "result": "PASS",
    "supplied_value": 1,
    "test": "? <= 2"
    }
    },
    "applicant1_results": {
    "applicant_results": {
    "max_retirement_age": {
    "@type": "NumericTestResult",
    "result": "PASS",
    "supplied_value": 70,
    "test": "? <= 70"
    },
    "name_match": {
    "@type": "UntestedResult",
    "result": "UNTESTED",
    "test": "? == ? from CREDIT_REPORT",
    "supplied_value": null
    },
    "minimum_income": {
    "@type": "NumericTestResult",
    "result": "PASS",
    "supplied_value": 50000,
    "test": "? >= 15000"
    },
    "is_uk_tax_resident": {
    "@type": "BooleanTestResult",
    "result": "PASS",
    "supplied_value": true,
    "test": "? == true"
    },
    "minimum_age": {
    "@type": "NumericTestResult",
    "result": "PASS",
    "supplied_value": 34,
    "test": "? >= 21"
    },
    "has_diplomatic_immunity": {
    "@type": "BooleanTestResult",
    "result": "PASS",
    "supplied_value": false,
    "test": "? == false"
    },
    "minimum_months_resident": {
    "@type": "NumericTestResult",
    "result": "PASS",
    "supplied_value": 25,
    "test": "? >= 24"
    },
    "has_criminal_conviction": {
    "@type": "BooleanTestResult",
    "result": "PASS",
    "supplied_value": false,
    "test": "? == false"
    },
    "minimum_months_employment_history": {
    "@type": "NumericTestResult",
    "result": "PASS",
    "supplied_value": 51,
    "test": "? >= 3"
    },
    "permitted_residency_statuses": {
    "@type": "AllowedValuesTestResult",
    "result": "PASS",
    "supplied_value": [
    "UK_OR_EEA_NATIONAL"
    ],
    "test": "[?] in [UK_NATIONAL, EEA_NATIONAL, UK_OR_EEA_NATIONAL, INDEFINITE_LEAVE_TO_REMAIN]"
    }
    },
    "aml_results": {
    "is_dead": {
    "@type": "UntestedResult",
    "result": "UNTESTED",
    "test": "? == false",
    "supplied_value": null
    },
    "has_forwarding_address": {
    "@type": "UntestedResult",
    "result": "UNTESTED",
    "test": "? == false",
    "supplied_value": null
    },
    "is_on_watchlist": {
    "@type": "UntestedResult",
    "result": "UNTESTED",
    "test": "? == false",
    "supplied_value": null
    },
    "is_on_cifas": {
    "@type": "UntestedResult",
    "result": "UNTESTED",
    "test": "? == false",
    "supplied_value": null
    }
    },
    "credit_results": {
    "all_payments_up_to_date": {
    "@type": "UntestedResult",
    "result": "UNTESTED",
    "test": "? == true",
    "supplied_value": null
    },
    "has_acceptable_discharged_ao": {
    "@type": "UntestedResult",
    "result": "UNTESTED",
    "test": "[?] not in [{ 0 within 100 years }]",
    "supplied_value": null
    },
    "has_acceptable_discharged_iva": {
    "@type": "UntestedResult",
    "result": "UNTESTED",
    "test": "[?] not in [{ 0 within 100 years }]",
    "supplied_value": null
    },
    "has_allowable_ccjs": {
    "@type": "UntestedResult",
    "result": "UNTESTED",
    "test": "[?] not { more than 0, within 6 years }",
    "supplied_value": null
    },
    "has_undischarged_dro": {
    "@type": "UntestedResult",
    "result": "UNTESTED",
    "test": "? == false",
    "supplied_value": null
    },
    "has_allowable_defaults": {
    "@type": "UntestedResult",
    "result": "UNTESTED",
    "test": "[?] not [{ 0, within months 0-36 }, { 2, within months 37-72, totalling £1000 }]",
    "supplied_value": null
    },
    "has_allowable_missed_payday_loan_pmts": {
    "@type": "UntestedResult",
    "result": "UNTESTED",
    "test": "[?] not [{ 0, within months 0-12 }, { 1, within months 13-36 }]",
    "supplied_value": null
    },
    "has_had_property_repossessed": {
    "@type": "UntestedResult",
    "result": "UNTESTED",
    "test": "? == false",
    "supplied_value": null
    },
    "has_acceptable_discharged_dmp": {
    "@type": "UntestedResult",
    "result": "UNTESTED",
    "test": "[?] not in [{ 0 within 100 years }]",
    "supplied_value": null
    },
    "has_undischarged_dmp": {
    "@type": "UntestedResult",
    "result": "UNTESTED",
    "test": "? == false",
    "supplied_value": null
    },
    "has_acceptable_discharged_bankruptcy": {
    "@type": "UntestedResult",
    "result": "UNTESTED",
    "test": "[?] not in [{ 0 within 100 years }]",
    "supplied_value": null
    },
    "has_been_disqualified_director": {
    "@type": "UntestedResult",
    "result": "UNTESTED",
    "test": "? == false",
    "supplied_value": null
    },
    "has_allowable_missed_comms_pmts": {
    "@type": "UntestedResult",
    "result": "UNTESTED",
    "test": "[?] not [{ 0, within months 0-3 }, { 1, within months 4-12 }]",
    "supplied_value": null
    },
    "has_undischarged_iva": {
    "@type": "UntestedResult",
    "result": "UNTESTED",
    "test": "? == false",
    "supplied_value": null
    },
    "has_acceptable_discharged_dro": {
    "@type": "UntestedResult",
    "result": "UNTESTED",
    "test": "[?] not in [{ 0 within 100 years }]",
    "supplied_value": null
    },
    "has_allowable_missed_unsecured_loan_pmts": {
    "@type": "UntestedResult",
    "result": "UNTESTED",
    "test": "[?] not [{ 0, within months 0-12 }, { 1, within months 13-36 }]",
    "supplied_value": null
    },
    "has_allowable_missed_secured_loan_pmts": {
    "@type": "UntestedResult",
    "result": "UNTESTED",
    "test": "[?] not { more than 1, within 3 years }",
    "supplied_value": null
    },
    "has_undischarged_ao": {
    "@type": "UntestedResult",
    "result": "UNTESTED",
    "test": "? == false",
    "supplied_value": null
    },
    "had_payday_loan": {
    "@type": "UntestedResult",
    "result": "UNTESTED",
    "test": "[?] not [{ 0, within months 0-12 }, { 1, within months 13-36, totalling £1000 }]",
    "supplied_value": null
    },
    "has_undischarged_bankruptcy": {
    "@type": "UntestedResult",
    "result": "UNTESTED",
    "test": "? == false",
    "supplied_value": null
    }
    }
    },
    "applicant2_results": {
    "applicant_results": {},
    "aml_results": {},
    "credit_results": {}
    },
    "property_results": {}
    }

Log In to reply.

Popular Salesforce Blogs

Popular Salesforce Videos