Web API Core | ComponentOne
Services / Data Engine Services / Unique Values
In This Topic
    Unique Values
    In This Topic

    Unique value service provides API to get the unique values of a field specified by{fieldname}. This service is not supported when you are connected to cube data. Your client application sends an HTTP request to the service application for using the Detail Data API to get the unique values of a field.

    Unique Value Service Request Schema

    To get the unique values of a field specified by {fieldname}, you need to use POST method. Data source information specified in the request URL, as:

    POST: http://<host>[:port]/api/dataengine/{datasourcekey}/fields/{fieldname}/uniquevalues

    Data source information can be specified in the request URL, as follows:

    Request URL: https://demos.componentone.com/ASPNET/5/C1WebAPI/3.0.20193.222/api/dataengine/complex10/fields/Product/uniquevalues
    Status Code: 200
    

    URL Parameters

    Unique value service includes the following parameters.

    Parameter Description
    datasourcekey Used to specify the data source from where you want to get the field information.
    fieldname Used to specify the field by the header which you want to get the unique values.
    View Definition Used to specify the view definition. For example:
    {
      fields:[
       {"binding":"Active","dataType":3},
       {"binding":"Country","dataType":1},
       {"binding":"Date","dataType":4},
       {"binding":"Discount","dataType":2},
       {"binding":"Downloads","dataType":2},
       {"binding":"ID","dataType":2},
       {"binding":"Product","dataType":1},
       {"binding":"Sales","dataType":2}
      ],
      rowFields:{items:["Product"]},
      columnFields:{items:["Country"]},
      valueFields:{items:["Sales"]}
    }

    Response Messages

    HTTP Status Code Reason
    200 An array is returned to specify the unique values of a field.
    404 {datasource} is invalid.

    For more information on Data Engine Services, see WebApiExplorer demo.