Skip to main content
5-Regular Member
May 31, 2016
Solved

Creating Things in bulk

  • May 31, 2016
  • 1 reply
  • 1934 views

Is there any support or recommendation for instantiating Things in bulk / in batches?  We'd like to be able to create many instances of a ThingTemplate, each representing a separate real-world asset, without having to do it manually through Composer.


In the past we've created scripts to generate importable XML files, but this feels like a clunky custom approach to what I thought would be a common operation.  Are there any alternatives?

Best answer by CarlesColl

Hi Chris,

You can easily implement something with Resources["EntityServices"].CreateThing(). I already did it through a csv (exported from Excel ) file with configuration parameters for each new thing.

Carles.

1 reply

1-Visitor
June 1, 2016

Hi Chris,

You can easily implement something with Resources["EntityServices"].CreateThing(). I already did it through a csv (exported from Excel ) file with configuration parameters for each new thing.

Carles.

5-Regular Member
June 1, 2016

Carles is right - Creating a Service, either through a Java Extension or as JavaScript, that gets called for each new Thing is the recommended way to achieve this.  This is a common use case for when Things need to get created 'on the fly'. 

However, doing a bulk import from something like a csv file (like Carles mentioned) is the correct approach if you want to add large numbers at one time.