Community Tip - Learn all about PTC Community Badges. Engage with PTC and see how many you can earn! X
Hi Everyone,
We are trying to fill in a thing name in the GetDesignTimePermission result infotable using the DeriveField snippet.
var params = {
type: "Thing" /* STRING */,
maxItems: 1000000 /* NUMBER */
};
var result1 = Resources["EntityServices"].GetEntityList(params);
var result2 = Things[result1.rows[0].name].GetDesignTimePermissions(); //This is only for a single entity for testing purposes
var params = {
types: "STRING" /* STRING */,
t: result2 /* INFOTABLE */,
columns: "EntityName" /* STRING */,
expressions: "result1.rows[0].name" /* STRING */
};
var result = Resources["InfoTableFunctions"].DeriveFields(params);
However we are having trouble finding a valid expression.
Error executing service GetDesignTimePermissionsforUser. Message :: Script evaluation error : ReferenceError: "result1" is not defined. (DSLCompiledExpressionProcessor#1) - See Script Error Log for more details.
What would be a valid expression to add the relevant thingname in a new column using DeriveFields?
Thanks,
Solved! Go to Solution.
Hi BradC,
I don't think you will be able to add the Thing name through the use of DeriveFields(). This infoTable function is listed in a calculations category and only seems to work with mathematical expressions in my testing.
It may not be ideal but you can add a new column to your infoTable by using AddField() and writing logic to fill the cell value.
Hi BradC,
I don't think you will be able to add the Thing name through the use of DeriveFields(). This infoTable function is listed in a calculations category and only seems to work with mathematical expressions in my testing.
It may not be ideal but you can add a new column to your infoTable by using AddField() and writing logic to fill the cell value.