Community Tip - If community subscription notifications are filling up your inbox you can set up a daily digest and get all your notifications in a single email. X
Please check below service code:
var connections;
if (filter == "blank") {
connections = Networks['FlowServeNetwork'].GetNetworkConnectionsWithTemplate();
} else {
var params = {
start : filter
};
connections = Networks['FlowServeNetwork'].GetSubNetworkConnectionsWithTemplate(params);
}
var params = {
dataShapeName : "FlowserveTreeNetwork",
infoTableName : "AssetHierarchy"
};
// CreateInfoTableFromDataShape(dataShapeName:STRING, infoTableName:STRING("")):INFOTABLE
var assets = Resources['InfoTableFunctions'].CreateInfoTableFromDataShape(params);
var connection;
for each(connection in connections.rows) {
var data = new Object();
data.to = connection.to;
data.from = connection.from;
data.connectionType = connection.connectionType;
var thing = Things[connection.to];
var alert = MediaEntities["YellowAlert"].GetImage();
data.description = thing.description + " " + alert; //appending alert icon with description
assets.AddRow(data);
}
var result = MediaEntities["YellowAlert"].GetImage();
----
am unable to append image with text. I have tried keeping description type as text,blob,string in datashape.
am getting error as "[context: com.thingworx.webservices.context.HttpExecutionContext@2ea80460][message: Execution error in service script [FlowserveNetworkServices testImage] : Unable To Convert From [B to INFOTABLE]"
Solved! Go to Solution.
You could try HTML, I know it worked for a text + image for a grid cell (from an infotable);
You cannot add an image to a description, description has to be a string type. What is your use case?
Is there any other type i can keep which will accept String and Image?
I have to display description (string + image) on tree label. Image will be dynamic attached to some description and that description need to be displayed on tree.
You could try HTML, I know it worked for a text + image for a grid cell (from an infotable);
So by keeping HTML as base type of one of my infotable fields.. it is possible to do that?
Thanks.. am able to append image to text in infotable.
I would use an infotable so one column carries the text the other the image.
If you are using this in a mashup, you can use state based formatting or use a composite of a value display with image display
I have kept description and image in different column in infotable. But i don't know how to display text+image on tree(text and image will change on logic).
Yes i have to show data in mashup and i have tried using state based formatting for tree but i am able to display icon then text and i need text then icon.