Community Tip - Stay updated on what is happening on the PTC Community by subscribing to PTC Community Announcements. X
Hello everyone,
I would like to put the BLOB value of Thing Avatars into a Info table. Please have a look at the code of my service below. Basically I am retrieving a Infotable of some Thing Templates. Now I would like to extend this info table with the avatar IMAGE or BLOB values.
The main thing is, that my client that calls this service should be able to decode the Image value (base64). Unfortunately, the values in the info table look like this when calling the service:
When I create a service which calls the Template.GetAvatar() method and returns the BLOB type I get the Long image string that I want. But for some reason the value is stored like above in my info table. I have also tried different types for the avatar Field in my infotable (like IMAGE, STRING)
Any help and suggestions are appreciated very much.
Best regards,
Dominik
var result = Resources["SearchFunctions"].SpotlightSearch(params); var newField = new Object(); newField.name = 'avatar'; newField.baseType = 'BLOB'; result.AddField(newField); var tableLength = result.rows.length; for (var x = 0; x < tableLength; x++) { var row = result.rows[x]; row['avatar'] = ThingTemplates[row['name']].GetAvatar(); }
Hello.
I found this article, which is a bit dated, which implies BLOB data should be managed within a DataShape or Thing object that subscribes to a change event. You may need to modify your code accordingly.
Thanks,
-- Craig A.
Hello @CRArko ,
thank you for your reply, but the reason why I want them in a Infotable is, because I want to retrieve multiple avatar images from a client device via Rest Call.
So far I have to make a Rest call for every single avatar to every single Entity. I would like to avoid that by retrieving all avatars I need at once.
Maybe you have a suggestion how to handle that without infotables?
Best Regards,
Dominik