Community Tip - Did you get called away in the middle of writing a post? Don't worry you can find your unfinished post later in the Drafts section of your profile page. X
Is it possible to get a list of all bound properties and their source and VTQ on a Thing by executing a service? Ideally I would like to monitor bad endpoints and create some notification to help track and fix any problems.
I have tried the getBound Items function with no success, even though I have quite a number of properties bound on my thing.
Hi @TMnemo_11 ,
If you want to get the remote bounded property values with quality,time & value means, below given code will helps you to acheive it. Kindly try with it, If any queries please let me know.
var params = {
infoTableName: "InfoTable",
dataShapeName: "PropertyDefinition"
};
// CreateInfoTableFromDataShape(infoTableName:STRING("InfoTable"), dataShapeName:STRING):INFOTABLE(PropertyDefinition)
var FinalData = Resources["InfoTableFunctions"].CreateInfoTableFromDataShape(params);
// result: INFOTABLE dataShape: "PropertyDefinition"
var PropertyData = Things[IP_AssetThingName].GetPropertyDefinitions({
category: undefined /* STRING */ ,
type: undefined /* BASETYPENAME */ ,
dataShape: undefined /* DATASHAPENAME */
});
// result: INFOTABLE dataShape: ""
var PropertyLiveData = Things[IP_AssetThingName].GetPropertyValuesAsMultiRowTable();
var a = 0;
for (; PropertyData.length > a; a++) {
var PropertyDataRow = PropertyData.rows[a];
try {
// result: INFOTABLE dataShape: "RemotePropertyBinding"
var BindingData = Things[IP_AssetThingName].GetRemotePropertyBinding({
propertyName: PropertyDataRow.name /* STRING */
});
PropertyDataRow.sourceName = BindingData.sourceName;
FinalData.AddRow(PropertyDataRow);
} catch (e) {}
}
var params = {
columns2: "name,description,baseType,isLogged,isPersistent,isReadOnly,sourceName" /* STRING */ , //
columns1: "name,quality,time,value" /* STRING */ ,
joinType: "INNER" /* STRING */ ,
t1: PropertyLiveData /* INFOTABLE */ ,
t2: FinalData /* INFOTABLE */ ,
joinColumns1: "name" /* STRING */ ,
joinColumns2: "name" /* STRING */
};
// result: INFOTABLE
var JoinData = Resources["InfoTableFunctions"].Intersect(params);
result = JoinData;
Expected Out:
Thanks & Regards,
Arun C