Hi,
We have published a Feature Service containing data and some of the fields are FieldType.Blob.
When we get the data using the ArcGIS MAp SDK we have no problem reading the field and using it. But if we want to set it`s value I get this exception:
System.NotSupportedException
The data type System.Byte[] is not supported.
at Esri.ArcGISRuntime.Data.CoreElementExtensions.SetAttributeValue(CoreElement element, Object value)
at Esri.ArcGISRuntime.Internal.AttributeDictionary.set_Item(String key, Object value)
I was passing a byte[]. So I checked the type of the attribute. It says ReadOnlyCollection<byte>. So I tried to set the value by transforming my byte[] to a ReadOnlyCollection<byte> and I get the same exception.
Si is it a SDK limitation? Is it just for now and later on it will be supported? Or is there something I can do differently to make it work?
These fields holds some serialized json transformed to byte[]. It was the best way we found to store large value in a field without having to set a field length. In SQL Server I would have used nvarchar(MAX) and store the json in text. Is there a better way to do that in ArcGIS/ArcGIS Online?
Thank you in advance.
Solved! Go to Solution.
Hi @PierreMasson - this is not supported at the moment. Feel free to contribute this idea on ArcGIS Maps SDKs Native Ideas
Hello @PierreMasson, thank you for your question. Would you kindly answer the following to better help me understand your issue?
It seems like this is the first time you've attempted this workflow, using a Blob field with our SDK?
Thanks,
William
Try to update the fields CanLiteConfigPACP, CanLiteConfigMACP, QCardConfigMACP or QCardConfigPACP of the feature here https://services6.arcgis.com/iLx36dZM4ZchIav8/ArcGIS/rest/services/SAM_20231221/FeatureServer/4
To answer your questions:
I can easily update the field using the web UI and passing a base64 string. Using the SDK, I can then read the value this way:
string base64String = System.Text.Encoding.Default.GetString(((IList<byte>)(Feature.GetAttributeValue("QCardConfigPACP"))).ToArray());
byte[] bytes = Convert.FromBase64String(base64String);
return System.Text.Encoding.UTF8.GetString(bytes);
But I can't write the attribute value.
Please help
Hi @PierreMasson - this is not supported at the moment. Feel free to contribute this idea on ArcGIS Maps SDKs Native Ideas