英文:
FilterOn and DynamicCriteria allowed values for MS Graph Excel Filter Criteria
问题
我正在寻找在描述筛选条件的filterOn
和dynamicCriteria
属性中允许的值,详见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.
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
以下是您要翻译的内容:
filterOn
属性
确定值是否应保持可见。
可能的值有:BottomItems
、BottomPercent
、CellColor
、Dynamic
、FontColor
、Values
、TopItems
、TopPercent
、Icon
、Custom
对于 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
}
}
dynamicCriteria
属性
与 Dynamic
过滤一起使用。
可能的值有: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
过滤平均值以上的值的示例。将 filterOn
设置为 Dynamic
,将 dynamicCriteria
设置为 AboveAverage
。
{
"criteria": {
"color": null,
"criterion1": null,
"criterion2": null,
"filterOn": "Dynamic",
"dynamicCriteria": "AboveAverage",
"icon": null,
"operator": "And",
"values": null
}
}
文档链接:
英文:
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
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
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
}
}
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:
通过集体智慧和协作来改善编程学习和解决问题的方式。致力于成为全球开发者共同参与的知识库,让每个人都能够通过互相帮助和分享经验来进步。
评论