Skip to main content
1-Visitor
October 13, 2014
Question

Using SearchModelTagTerm to get a list of ThingTemplates with this tag

  • October 13, 2014
  • 1 reply
  • 1011 views

I'm trying to get an infotable of Thing Templates that have a particular model tag. I can't figure out how to define the "types" parameter so that only ThingTemplates are returned

    1 reply

    5-Regular Member
    October 13, 2014

    Hi David,

    The types parameter expects a JSON object of the following form:


      "items": ["Thing","ThingShape","ThingTemplate","DataShape","Network","ModelTagVocabulary","Mashup", "Menu","MediaEntity","StyleDefinition","StateDefinition","DataTagVocabulary","Group","User","ApplicationKey",

    "Resource","Organization","Dashboard"]

    }


    In your case, you'd simply have an items array that contains one item, "ThingTemplate".


    Regards,

    Adam



    davidcor1-VisitorAuthor
    1-Visitor
    October 13, 2014

    Here is the ode that I am using and it is still returning all entity types

    var myObject = new Object();

    myObject = ;

    var params = {

     term: "TrackingDeviceModelTemplate" /* STRING /,<br> types: myObject / JSON */
    };
    var result = Resources["SearchFunctions"].SearchModelTagTerm(params);