How to read the FragmentSeries from an API call

I have developed a service that retrieves a list of custom measurements using the MeasurementService:

  async getModeMeasurements(startDate: string, endDate: string){
  try{
    const filter = {
      dateFrom: startDate,
      dateTo: endDate,
      type: 'mode',
      pageSize: 2000,
      revert:true
    }
  
    const {data, res, paging} = await this.measurementService.list(filter);
    return {data, res, paging};
  }
  catch (error){
    console.error('Error occurred while loading the device description: ', error)
  }
}

In my component, I want to call this method and then read the ValueFragmentType to execute some conditional logic based on its value. The ValueFragmentSeries can have 1 of 6 types:

private getModeUsageByDate(startDate: string, endDate: string):void {
  this.liveDashboardService
      .getModeMeasurements(startDate, endDate)
      .then((result) => {
        var len: number = result.data.length;
        for(let i = 0; i < len; i++){
          // Get ValueFragmentSeries
          switch([ValueFragmentSeries]){
          //    [case logic]
          }
        }
      })
}

Is it possible to extract this information?

This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.