Community Tip - Did you get an answer that solved your problem? Please mark it as an Accepted Solution so others with the same problem can find the answer easily. X
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'
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.