Custom Attribute JSON values

I’ve been working with Customer Custom Attributes via the .Net API and have used the JsonValue.FromInteger(value) and JsonValue.FromString(value) functions to encode variables into JSON format for upserting. Are there reverse functions that decode a JSON value back to the respective variable type when retrieving? ie. what is the best way to convert CustomAttribute.MValue back to a C# string that contains actual linefeed characters etc, because .ToString() just returns the encoded JSON string.

You can decode a JSON value back to the respective variable type, with the JsonSerializer.Deserialize method. :slightly_smiling_face: