Community Tip - Visit the PTCooler (the community lounge) to get to know your fellow community members and check out some of Dale's Friday Humor posts! X
How can I populate a list of Things, where each of the things share a common property? The things are all created from the same template. I have been trying to use the getimplementingthings service, but I cant see where it allows me to filter.
Solved! Go to Solution.
You can use QueryimplementingThings but that will only allow you to filter on Values of properties.
If you need to filter on an actual Property definition, you will have to iterate and populate the information into a new table.
You can use QueryimplementingThings but that will only allow you to filter on Values of properties.
If you need to filter on an actual Property definition, you will have to iterate and populate the information into a new table.
I ended up having to create a service to accomplish this task. Maybe we can get some built in filtering in the next version
Even though we provide some base services that help filter, best practice is to create 'wrapped' services that use these base services so that you can properly secure them.
Brian, Could you share example of your service you have created? I've been struggling to accomplish similar task.
I am not sure if this is the best way to do it but it works!
var table1 = ThingTemplates["Thing1"].GetImplementingThingsWithData();
var table2 = ThingTemplate["Thing2"].GetImplementingThingsWithData();
var tableLength = table2.rows.length;
for (var x = 0; x < tableLength; x++) {
var row = table2.rows
table1.AddRow(row);
}
var Result=table1
You can also use the query services, and then there is a combine command that will combine 2 tables for you.
Hope this helps!
Thanks Brian!