FilterOn and DynamicCriteria allowed values for MS Graph Excel Filter Criteria

0 votes

I'm searching for the permitted values for the filterOn and dynamicCriteria attributes displayed in the Filter: apply filter criteria. I am unable to determine what are valid numbers because of how generic the sample values provided in the manual are.

Example Call

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"
  }
}
Jan 8 in Others by Kithuzzz
• 28,900 points
59 views

1 answer to this question.

0 votes

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

enter image description here

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

answered Jan 8 by narikkadan
• 53,520 points

Related Questions In Others

0 votes
1 answer

How to define excel SUMIFS criteria considering any text and numbers?

It essentially ignores column C's missing entry ...READ MORE

answered Oct 1, 2022 in Others by narikkadan
• 53,520 points
134 views
0 votes
1 answer

Statistical Kurtosis in relation to SPSS and MS excel

Kurtosis does not measure "peakedness" or "height" ...READ MORE

answered Oct 20, 2022 in Others by narikkadan
• 53,520 points
79 views
0 votes
1 answer

How to Freeze Top Row and Apply Filter in Excel Automation with C#

Try this: // Fix first row workSheet.Activate(); workSheet.Application.ActiveWindow.SplitRow = 1; workSheet.Application.ActiveWindow.FreezePanes ...READ MORE

answered Oct 22, 2022 in Others by narikkadan
• 53,520 points
343 views
0 votes
1 answer

How to add Conditional Formatting in Excel for a Range of Values

Three distinct rules are required, one for ...READ MORE

answered Oct 24, 2022 in Others by narikkadan
• 53,520 points
131 views
0 votes
1 answer

Calculate Birthdate from an age using y,m,d in Excel

Hello, yes u can find your birthdate using ...READ MORE

answered Feb 16, 2022 in Others by Edureka
• 13,630 points
215 views
0 votes
1 answer

Calculate Birthdate from an age using y,m,d in Excel

Hi To Calculate the date, we can ...READ MORE

answered Feb 16, 2022 in Others by Edureka
• 13,630 points
395 views
0 votes
0 answers

Convert Rows to Columns with values in Excel using custom format

1 I having a Excel sheet with 1 ...READ MORE

Feb 17, 2022 in Others by Edureka
• 13,630 points
177 views
0 votes
1 answer

IF - ELSE IF - ELSE Structure in Excel

In this case, you can use nested ...READ MORE

answered Feb 18, 2022 in Others by gaurav
• 22,960 points
165 views
0 votes
1 answer

Excel formula for searching two text in one cell and return values based on the result

You can include a second IF within ...READ MORE

answered Oct 10, 2022 in Others by narikkadan
• 53,520 points
208 views
0 votes
1 answer

Thousand and million formatting for negative numbers (excel/ googlesheets)

Its not possible. What you could do is ...READ MORE

answered Sep 25, 2022 in Others by narikkadan
• 53,520 points
163 views
webinar REGISTER FOR FREE WEBINAR X
REGISTER NOW
webinar_success Thank you for registering Join Edureka Meetup community for 100+ Free Webinars each month JOIN MEETUP GROUP