I have a content item with a property “mediaFolder” of type “MediaPicker” that is restricted to only allow Folders to be selected. When I select a media folder and try to access that in a custom api, the field seems to come back as a json string only: [{"key":"66fa2026-97bf-468b-9dd0-593983d86a63","mediaKey":"c522a36d-e426-4fd5-b576-da889cc11ecc","mediaTypeAlias":"","crops":[],"focalPoint":null}]
If I try to convert this to “MediaWithCrops” (as it should return that according to https://docs.umbraco.com/umbraco-cms/fundamentals/backoffice/property-editors/built-in-umbraco-property-editors/media-picker-3), I receive null as the value.
My code looks like this:
var mediaFolder = contentItem.GetValue<MediaWithCrops>("mediaFolder");
How can I get the actual media folder item (so technically the item with the “mediaKey” from of the response json)?
Thanks in advance for the help.