Philippe Capouillez
Philippe Capouillez

Reputation: 11

Create a connector: How to put an initial/default value in a field

I would like to set a default value in a field, but I don't find the function.

CONFIG

var myField = cc.newDimension() // Or newMetric
  .setId('my_unique_identifier')
  .setName('My friendly name')
  .setDescription('My short description')
  .setType(types.YEAR_MONTH_DAY)
  .setGroup('My group name');

Upvotes: 0

Views: 211

Answers (1)

Minhaz Kazi
Minhaz Kazi

Reputation: 3168

This currently is a missing feature. There isn't a built in way for having an initial/default value for a field.

The way to get around is to implement your own config validation method which will assign the default values if any of the values are missing/matches certain criteria. See example code here.

Upvotes: 1

Related Questions