Skip to main content
Apr 18, 2018 12:27 PM UTC
Solved

How to add default suffix to entity name?

Hi,

I want to give entity name as TreeThing_abc where _abc is the suffix. Whenever I want to give the name for any entity, _abc should come by default and then I'll add the prefix name based on the entity that I create. Is there any possibility to get default name for entity name.

 

thanks

sameera

Apr 19, 2018 7:07 AM UTC

You just need to use CreateThing snipped and add the desired sufix:

var sufix = "_mySufix";

Resources["EntityServices"].CreateThing({

  name: "myCustomName"+sufix,

 description: "",

  thingTemplateName: "GenericThing",

  tags: undefined

})

6 replies

Apr 18, 2018 12:29 PM UTC

Not with the Composer, but you can create a custom service in order to create entities and in this service add the suffix by the rules you desire, it's how we do it.

Apr 19, 2018 5:25 AM UTC

Thanks @CarlesColl, 

Is there any snippet to add suffix for entity name.

 

Thanks

sameera

Apr 19, 2018 7:07 AM UTC

You just need to use CreateThing snipped and add the desired sufix:

var sufix = "_mySufix";

Resources["EntityServices"].CreateThing({

  name: "myCustomName"+sufix,

 description: "",

  thingTemplateName: "GenericThing",

  tags: undefined

})