How to update field labels in Studio


#1

Hi,
How can I update field labels in Studio? I tried the “Load Metadata” option and I selected my provider (BigQuery) but I am not sure what to enter after that.


#2

Hi @Jack,

The easiest way is to check the Studio’s sample application. To load the sample app, click on the 'New" button on the home page and use the “Import Sample Application” option. Then, open the metadata of this app by using the “Load Metadata” option and selecting the data provider.

As you will see in the example, the important part to provide metadata to a Studio app is to provide the META variable as shown below:

let _META_ = {
    'london_fire_brigade': {
        'count': {
          'label': 'Calls'
        },        
        'fields': {
            'date_of_call': {
                'label': "Date of Call"
            }
        }
    }
}

‘london_fire_brigade’ is the source name. You can provide field labels within the ‘fields’ object. Use ‘count’ to provide a label for the count metric. The documentation that describes the metadata structure is here.

Let me know any additional questions.


#3

As @jorge explained, the best way is by setting the metadata, this way all visualizations will benefit from the new labels. But in case you just want one or two visuals with custom labels, you can use the Attribute or the Field (for the Raw Data Table) objects to set them:

 let group = cf.Attribute('field_name', 'Custom Label')
                    .limit(10)
                    .sort(...)
 let field = cf.Field('field_name', 'Custom Label')

The downside of this alternative is that you have to define them for each visualization, however it can be very useful if even though you’ve defined own labels in your metadata, you still want custom labels for one specific visual, since the visual will use these labels instead of those defined in the metadata.


#4

Thanks guys! Updating labels for all charts is what I was looking for. After updating the metadata, all charts and tables in my application are now rendering the specified labels. Good to know I can also specify different field labels at the chart level if needed.