Hot answers tagged

5 votes
Accepted

Adding spaces to an apex class definition

After re-reading your question, the solution here is indeed either to modify the JSON before you deserialize it, or deserialize untyped. Using JSON.deserailizedUntyped() would look like // Using a Map&...
  • 50.5k
3 votes

Error:Invalid conversion from runtime type Map<String,ANY> to List<ANY> Class

Edit As @PhilW said in his comment: "If none of the property names clashes with an apex reserved word it is IMHO far better to used typed (rather than untyped) deserialization." I agree. ...
  • 2,318
3 votes

Storing JSON API payload in triggered send data extension field

There are may be better ways to achieve your requirement, this is how I would tackle. Key Challenges and solution Fields which needs to store JSON require more than 4000 chars which you can overcome ...
3 votes
Accepted

Can't parse JSON properly - access to inner list values

[] is a list of items, so you just need to access the zeroth index: block.regionalBlocs[0].acronym Alternatively, you can also loop over the regionalBlocs data: for(Countries_info.RegionalBlocs ...
  • 445k
2 votes
Accepted

Lightning Aura Iterate over JSON object Keys

Has anyone else been able to successfully use the Aura:Iteration element over this type of JSON structure? No, nobody has been able to directly iterate over this, because that's impossible. You can ...
  • 445k
2 votes
Accepted

How to get All Recordtype Names in LWC

In general, you want to use Array.prototype.map to convert an Array from one type to another. let arr = Object.values(data.recordTypeInfos).map( ({ name: label, recordTypeId: value }) => ({ ...
  • 445k
1 vote
Accepted

Error: No field name specified on column for sobject of type Document__c when deserializing JSON

JSON for List<Document__c> would look like this: [ { "attributes": { "type": "Document__c", "url": "/services/data/v35.0/...
  • 131k

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