Hot answers tagged

3 votes

Get values from nested JSON dictionaries in Apex

I'm the author of the libshare JsonMapper is a utility class I wrote as part of libshare opensource package. This makes it easy to read raw json. For ex., new JsonMapper(jsonStr).getString('values[0]....
user avatar
  • 1,434
2 votes

Get values from nested JSON dictionaries in Apex

Actually resolved this myself after struggling with it for far too long! Problem was that the key/value list is the first item. // convert json of response to map String jsonStr = feedResponse....
user avatar
  • 23
2 votes
Accepted

Get values from nested JSON dictionaries in Apex

When working with untyped JSON deserialization, you end up needing to do a lot of explicit typecasting. To get at your workspaceId, you would... // Because "values" is a JSON array, cast it ...
user avatar
  • 46.6k
1 vote
Accepted

How to access an Apex Map in LWC JS

To access the first element, the access would look like this: let firstMortageAccount = this.addressesAndMortgageAccounts[ 'Address__c:{Id=a0L25000005W8rKEAS, Address_Line_1__c=Test Street, ...
user avatar
  • 430k
1 vote

Count number of values under specific JSON key

Yes there is. This answer was written before your edit. The general idea still applies. This answer also assumes that you have valid JSON (your example is not valid as written). But first, don't use ...
user avatar
  • 46.6k

Only top scored, non community-wiki answers of a minimum length are eligible