Thank you for breaking this out into a separate topic, and for taking the time to help.
The reason I’m trying to read the layout.jsonc files is that I’m having issues in App Studio that I cannot fix in the UI. Specifically, the refresh button in Customer disappeared completely in one of my layers. I never removed it, but it is gone. I can add it back, but App Studio keeps defaulting the tool properties to have a style of “Primary”. Removing Primary and 0 in these properties won’t save:
So my plan was to physically remove the Primary and 0 values from the JSON file.
I’ve tried a bunch of different pieces of code to format the output I’ve found on these forums - mostly yours.
The function I tried last night was this (I removed the full json because it was messing up this posts’ formatting):
string json = "{\"config\":{\"Name\":\"config\",\"Version\":\"2.0\"}
Newtonsoft.Json.Linq.JObject obj =JsonConvert.DeserializeObject<Newtonsoft.Json.Linq.JObject>(json);
DataSet resultDS = JsonConvert.DeserializeObject<DataSet>(obj["config"].ToString());
output = resultDS;
I also tried your template suggestions here, attempting to pull out the “config” object: