@alenaromi ,
For my test I used ThingWorx 8.5.2. With that version I was able to accomplish your goal.
I defined an info table which was part of a thing and a Service.
I used the Thing Service GetProperties to return the infotable which I linked to the dropdown widget data field.
The ServiceInvokeCompleted event on the GetProperties to run a service I created SetSelectedRow.
This service takes one input an infotable from GetProperties and has one output an InfoTable which is linked to the dropdown widget Selected Data.
The code in my service looked like:
var listCount = inDropDownTable.getRowCount();
var params = {
infoTableName : "InfoTable",
dataShapeName : "Community-Dropdown-V1-DataShape"
};
// CreateInfoTableFromDataShape(infoTableName:STRING("InfoTable"), dataShapeName:STRING):INFOTABLE(Community-Dropdown-V1-DataShape)
var result = Resources["InfoTableFunctions"].CreateInfoTableFromDataShape(params);
if (listCount == 1) {
// Community-Dropdown-V1-DataShape entry object
var firstRow = inDropDownTable.getRow(0);
var newEntry = new Object();
newEntry.id = firstRow.id; // NUMBER [Primary Key]
newEntry.Value1 = firstRow.Value1; // STRING
result.AddRow(newEntry);
}
// Return value is empty table when more then 1 row
// Return value is info table with one row when input has one row.
Let me know if you have any questions.
Peter