cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
Showing results for 
Search instead for 
Did you mean: 

Community Tip - Stay updated on what is happening on the PTC Community by subscribing to PTC Community Announcements. X

Create NewThing with Tag service

michaele
1-Newbie

Create NewThing with Tag service

Hello I am using the following code to create a NewThing.  One of the parameter inputs is called 'tag' and I have set this to required, and it has a default value.

var params = {

    tags: tag /* TAGS */,

  thingTemplateName: 'CustomerSiteTemplate' /* THINGTEMPLATENAME */,

  description: undefined /* STRING */,

  name: SiteName /* STRING */

};

Resources["EntityServices"].CreateThing(params);

When I test the code I get no errors.  But when I go back to Composer...

The Thing has been created, but it has no tags

I would have expected it to have the defualt value I specified in the inputs.....  And yes 'tag' has a type of 'Tags'

2 REPLIES 2
paic
1-Newbie
(To:michaele)

There is a bug in the platform that won't allow the tags to be created on the initial create.

So you need to first do the CreateThing, then EnableThing and RestartThing.

After that you can do the AddTags or SetTags service.

katte
1-Newbie
(To:paic)

Pai Chung​ Is the issue fixed in the latest release?

Top Tags