Hoping someone has more experience with this and can point me in the right direction.
Have a custom method that goes and gets data from Salesforce via REST API. The response comes back and I want to return the "records" array back to front end for display.
JObject obj = JObject.Parse(data);
System.Console.WriteLine(obj["records"].ToString());
This is the output to the console;
"[
{
"attributes": {
"type": "Account",
"url": "/services/data/v52.0/sobjects/Account/Id"
},
"Id": "0016xxxxxxxxxx",
"Name": "xxxxxx",
"BillingStreet": "xxxxxxx"
}
]"
Not really sure how to return this, everything I try the datagrid does not recognize the variable set with the result.
Tried many different variations;
return Json(new { value = obj["records"] }, new JsonSerializerSettings() {
ContractResolver = new DefaultContractResolver()
});
Any thoughts on what I'm doing wrong. I set a variable to ${result.value} but doesn't show for binding to datagrid.
Thanks,