Data Transformer: Pluck

Edit on GitHub

This document explains the Data Transformer Pluck service in the Components Library.


Data Transformer Pluck is an Angular Service that selects and returns a nested object by path via configuration.

The following datasource example returns the value of the three key (‘123’) of the data input after receiving the response.

Service configuration:

  • path—the name of the property from which the value needs to be retrieved. The path may contain nested properties separated by dots, just like in Javascript.
        type: 'inline',
        data: {
            one: {
                two: {
                    three: '123',  
        transform: {
            type: 'pluck',
            path: 'one.two.three',

Service registration

Register the service:

declare module '@spryker/data-transformer' {
    interface DataTransformerRegistry {
        pluck: PluckDataTransformerService;

    imports: [
            pluck: PluckDataTransformerService,
export class RootModule {}


Below you can find interfaces for the Data Transformer Pluck:

export interface PluckDataTransformerConfig extends DataTransformerConfig {
    path: string;