Skip to main content

You are not logged in. Your edit will be placed in a queue until it is peer reviewed.

We welcome edits that make the post easier to understand and more valuable for readers. Because community members review edits, please try to make the post substantially better than how you found it, for example, by fixing grammar or adding additional resources and hyperlinks.

Required fields*

3
  • You could have your sobject_field__c be a string and allow this to be a path, like "Account.Name". Similarly allow your json_field__c to be a JSON path, like "account.name". You need to make sure you're smart about translating bundles of field paths that actually identify related lists into arrays in the output JSON, but that just needs some smarts in your code to detect and handle. Commented Jun 25, 2021 at 10:52
  • For identifying that i have a picklist field called type_in_json__c which holds one of the following values: field,object,array. Commented Jun 25, 2021 at 13:42
  • That's an option, but I don't think it fits with making it fully dynamic IMHO, since you need to always map to the SObject structure which itself would tell you it is a field or (related list) array. Commented Jun 25, 2021 at 13:44