0

my http response is as shown:

{"controllerValues":{},"defaultValue":null,"eTag":"31935b5a76250197159c64a2a9ec8353","url":"/services/data/v43.0/ui-api/object-info/Opportunity/picklist-values/0126F0000022ATfQAM/StageName","values":[{"attributes":{"closed":true,"defaultProbability":100.0,"forecastCategoryName":"Closed","picklistAtrributesValueType":"OpportunityStage","won":true},"label":"Closed Won","validFor":[],"value":"Closed Won"},{"attributes":{"closed":false,"defaultProbability":5.0,"forecastCategoryName":"Pipeline","picklistAtrributesValueType":"OpportunityStage","won":false},"label":"Personal Details","validFor":[],"value":"Personal Details"},{"attributes":{"closed":false,"defaultProbability":15.0,"forecastCategoryName":"Pipeline","picklistAtrributesValueType":"OpportunityStage","won":false},"label":"Add Products","validFor":[],"value":"Add Products"},{"attributes":{"closed":false,"defaultProbability":25.0,"forecastCategoryName":"Pipeline","picklistAtrributesValueType":"OpportunityStage","won":false},"label":"Add Schemes","validFor":[],"value":"Add Schemes"},{"attributes":{"closed":false,"defaultProbability":40.0,"forecastCategoryName":"Pipeline","picklistAtrributesValueType":"OpportunityStage","won":false},"label":"Bank Details","validFor":[],"value":"Bank Details"},{"attributes":{"closed":false,"defaultProbability":60.0,"forecastCategoryName":"Pipeline","picklistAtrributesValueType":"OpportunityStage","won":false},"label":"Verification","validFor":[],"value":"Verification"},{"attributes":{"closed":false,"defaultProbability":65.0,"forecastCategoryName":"Pipeline","picklistAtrributesValueType":"OpportunityStage","won":false},"label":"Documents Review","validFor":[],"value":"Documents Review"},{"attributes":{"closed":false,"defaultProbability":95.0,"forecastCategoryName":"Pipeline","picklistAtrributesValueType":"OpportunityStage","won":false},"label":"Credit Approval","validFor":[],"value":"Credit Approval"},{"attributes":{"closed":false,"defaultProbability":90.0,"forecastCategoryName":"Pipeline","picklistAtrributesValueType":"OpportunityStage","won":false},"label":"Contract Signing","validFor":[],"value":"Contract Signing"}]}

how do i get all the value values? I mean i need to get Add Products,Contact Signing,Bank details etc in a list in an apex class.

1

There are basically two ways to parse JSON into a data structure accessible in Apex:

  1. By parsing it into an untyped map of string to object properties OR
  2. By parsing it into a specific set of Apex objects, which can be an object hierarchy.

The documentation covers this adequately. Take a look at the JSON.deserializeUntyped and JSON.deserialize/deserializeStrict methods.

Your Answer

By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

Not the answer you're looking for? Browse other questions tagged or ask your own question.