toDataItem

fun JsonElement.toDataItem(recordType: RecordType): DataItem

Converts JsonElement to DataItem based on the given record type.

Note: pictures and blobs are base64 encoded! Base64 is chosen for ease of conversion to "data:" URLs.