Skip to main content
1-Visitor
April 18, 2018
Solved

How to add default suffix to entity name?

  • April 18, 2018
  • 1 reply
  • 3546 views

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

Best answer by CarlesColl

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

})

1 reply

1-Visitor
April 18, 2018

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.

1-Visitor
April 19, 2018

Thanks @CarlesColl

Is there any snippet to add suffix for entity name.

 

Thanks

sameera

1-Visitor
April 19, 2018

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

})