Skip to main content
1-Visitor
January 8, 2013
Question

Programmatically set Mashup tags?

  • January 8, 2013
  • 2 replies
  • 2423 views

Is there a way to change Mashup tags via script?

I have several (~40) Mashups which need a tag removed.

2 replies

1-Visitor
January 9, 2013

Chad, 

Every Thingworx entity has a service for adding tags and removing tags. You simply pass in the tag that you want to add or remove. For example: http://server/Thingworx/Users/ryan.miller@thingworx.com/Services/RemoveTags?tags=Applications:FancyApp will remove the 'Applications:FancyApp' from the User ryan.miller@thingworx.com.

11-Garnet
January 9, 2013

Assuming that you are referring to ThingWorx scripting, in the current 3.2 version you cannot 'directly' script to a Mashup. In theory you will be able to do the following in 4.0:


var params = {

tags: undefined /* TAGS */

};

Mashups["<MashupName>"].RemoveTags(params);

...but as Ryan points out you could always use direct API calls in external scripts...this could even be facilitated in a ThingWorx script using the ContentLoader Resource Post functionality, although we don't consider it best practice to call a ThingWorx API (via URL) from within a ThingWorx script.