FilterOn和DynamicCriteria是MS Graph Excel筛选条件的允许值。

huangapple go评论135阅读模式
英文:

FilterOn and DynamicCriteria allowed values for MS Graph Excel Filter Criteria

问题

我正在寻找在描述筛选条件的filterOndynamicCriteria属性中允许的值,详见Filter: apply。文档中提供的示例值非常通用,以至于我无法理解哪些是有效值。

POST https://graph.microsoft.com/v1.0/me/drive/items/{id}/workbook/tables/{id|name}/columns/{id|name}/filter/apply
Content-type: application/json

{
  "criteria": {
    "criterion1": "criterion1-value",
    "criterion2": "criterion2-value",
    "color": "color-value",
    "operator": {
    },
    "icon": {
      "set": "set-value",
      "index": 99
    },
    "dynamicCriteria": "dynamicCriteria-value",
    "values": {
    },
    "filterOn": "filterOn-value"
  }
}
英文:

I am looking for the allowed values for the filterOn and dynamicCriteria properties shown in the filter criteria described at Filter: apply. The sample values provided in the documentation are so generic that I can't understand what are valid values.

FilterOn和DynamicCriteria是MS Graph Excel筛选条件的允许值。

POST https://graph.microsoft.com/v1.0/me/drive/items/{id}/workbook/tables/{id|name}/columns/{id|name}/filter/apply
Content-type: application/json

{
  "criteria": {
    "criterion1": "criterion1-value",
    "criterion2": "criterion2-value",
    "color": "color-value",
    "operator": {
    },
    "icon": {
      "set": "set-value",
      "index": 99
    },
    "dynamicCriteria": "dynamicCriteria-value",
    "values": {
    },
    "filterOn": "filterOn-value"
  }
}

答案1

得分: 1

以下是您要翻译的内容:

  1. filterOn 属性

确定值是否应保持可见。

可能的值有:BottomItemsBottomPercentCellColorDynamicFontColorValuesTopItemsTopPercentIconCustom

对于 Values 的请求示例。假设您有以下表格,并希望从 Column1 中选择值 1、3 和 5。

POST /v1.0/me/drive/items/{item_id}/workbook/tables/{table_name}/columns/1/filter

{
  "criteria": {
    "color": null,
    "criterion1": null,
    "criterion2": null,
    "filterOn": "Values",
    "dynamicCriteria": "Unknown",
    "icon": null,
    "operator": "And",
    "values": [
        "1",
        "3",
        "5"
    ]
  }
}

显示大于 2 的值

{
    "criteria": {
        "color": null,
        "criterion1": ">2",
        "criterion2": null,
        "filterOn": "Custom",
        "dynamicCriteria": "Unknown",
        "icon": null,
        "operator": "Or",
        "values": null
    }
}
  1. dynamicCriteria 属性

Dynamic 过滤一起使用。

可能的值有:UnknownAboveAverageAllDatesInPeriodAprilAllDatesInPeriodAugustAllDatesInPeriodDecemberAllDatesInPeriodFebrurayAllDatesInPeriodJanuaryAllDatesInPeriodJulyAllDatesInPeriodJuneAllDatesInPeriodMarchAllDatesInPeriodMayAllDatesInPeriodNovemberAllDatesInPeriodOctoberAllDatesInPeriodQuarter1AllDatesInPeriodQuarter2AllDatesInPeriodQuarter3AllDatesInPeriodQuarter4AllDatesInPeriodSeptemberBelowAverageLastMonthLastQuarterLastWeekLastYearNextMonthNextQuarterNextWeekNextYearThisMonthThisQuarterThisWeekThisYearTodayTomorrowYearToDateYesterday

过滤平均值以上的值的示例。将 filterOn 设置为 Dynamic,将 dynamicCriteria 设置为 AboveAverage

{
    "criteria": {
        "color": null,
        "criterion1": null,
        "criterion2": null,
        "filterOn": "Dynamic",
        "dynamicCriteria": "AboveAverage",
        "icon": null,
        "operator": "And",
        "values": null
    }
}

文档链接:

Excel filterCriteria

英文:

The filtering criteria applied to a column are not documented but it's very similar to Excel Javascript API.

https://learn.microsoft.com/en-us/javascript/api/excel/excel.filtercriteria?view=excel-js-preview

  1. filterOn property

Determines whether the values should stay visible.

Possible values are: BottomItems, BottomPercent, CellColor, Dynamic, FontColor, Values, TopItems, TopPercent, Icon, Custom

Example of the request body for Values. Lets say you have the following table and you want to select values 1,3 and 5 from Column1

FilterOn和DynamicCriteria是MS Graph Excel筛选条件的允许值。

POST /v1.0/me/drive/items/{item_id}/workbook/tables/{table_name}/columns/1/filter

{
  "criteria": {
    "color": null,
    "criterion1": null,
    "criterion2": null,
    "filterOn": "Values",
    "dynamicCriteria": "Unknown",
    "icon": null,
    "operator": "And",
    "values": [
        "1",
        "3",
        "5"
    ]
  }
}

Display values greater than 2

{
    "criteria": {
        "color": null,
        "criterion1": ">2",
        "criterion2": null,
        "filterOn": "Custom",
        "dynamicCriteria": "Unknown",
        "icon": null,
        "operator": "Or",
        "values": null
    }
}
  1. dynamicCriteria property

Used with Dynamic filtering.

Possible values are: Unknown, AboveAverage, AllDatesInPeriodApril, AllDatesInPeriodAugust, AllDatesInPeriodDecember, AllDatesInPeriodFebruray, AllDatesInPeriodJanuary, AllDatesInPeriodJuly, AllDatesInPeriodJune, AllDatesInPeriodMarch, AllDatesInPeriodMay, AllDatesInPeriodNovember, AllDatesInPeriodOctober, AllDatesInPeriodQuarter1, AllDatesInPeriodQuarter2, AllDatesInPeriodQuarter3, AllDatesInPeriodQuarter4, AllDatesInPeriodSeptember, BelowAverage, LastMonth, LastQuarter, LastWeek, LastYear, NextMonth, NextQuarter, NextWeek, NextYear, ThisMonth, ThisQuarter, ThisWeek, ThisYear, Today, Tomorrow, YearToDate, Yesterday

Example how to filter values above the average. Set filterOn to Dynamic and dynamicCriteria to AboveAverage.

{
    "criteria": {
        "color": null,
        "criterion1": null,
        "criterion2": null,
        "filterOn": "Dynamic",
        "dynamicCriteria": "AboveAverage",
        "icon": null,
        "operator": "And",
        "values": null
    }
}

Documentation:

Excel filterCriteria

huangapple
  • 本文由 发表于 2023年1月6日 11:35:22
  • 转载请务必保留本文链接:https://go.coder-hub.com/75026681.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定