SharePoint ODATA Filter

Vom SharePoint REST-Dienst unterstützte OData-Abfrageoperatoren

UnterstütztNicht unterstützt
Numerische Vergleiche 
Lt Le Gt Ge Eq Ne
Arithmetische Operatoren (Add, Sub, Mul, Div, Mod)
Grundlegende mathematische Funktionen (Runden, Untergrenze, Obergrenze)
String-Vergleiche 
startsWith
substringof
Eq
Ne
endsWith replace substring tolower toupper trim concat
Datums- und Uhrzeitfunktionen day() month() year() hour() minute() second()Operator „DateTimeRangesOverlap“
Abfrage, ob Datum-Zeit in ein wiederkehrendes Datum-Zeit-Muster fällt

Die folgende Abbildung zeigt unterstützte OData-Abfrageoptionen.

Zum Sortieren kann asc und desc verwendet werden!

Hilfreiche Links zu diesem Thema:

https://sharepains.com/2018/11/12/sharepoint-get-items-odata-filter-query/

Weitere Beispiele:

Select a range of valuesCopyfilter=Entry_No gt 610 and Entry_No lt 615Query on GLEntry service. Returns entry numbers 611 through 614...
AndCopyfilter=Country_Region_Code eq 'ES' and Payment_Terms_Code eq '14 DAYS'Query on Customer service. Returns customers in Spain where Payment_Terms_Code=14 DAYS.&
OrCopyfilter= Country_Region_Code eq 'ES' or Country_Region_Code eq 'US'Query on Customer service. Returns customers in Spain and the United States.Hh169248.Important(en-us,NAV.90).gifImportantYou can use OR operators to apply different filters on the same field. However, you cannot use OR operators to apply filters on two different fields.|
Less thanCopyfilter=Entry_No lt 610Query on GLEntry service. Returns entry numbers that are less than 610.<
Greater thanCopyfilter= Entry_No gt 610Query on GLEntry service. Returns entry numbers 611 and higher.>
Greater than or equal toCopyfilter=Entry_No ge 610Query on GLEntry service. Returns entry numbers 610 and higher.>=
Less than or equal toCopyfilter=Entry_No le 610Query on GLEntry service. Returns entry numbers up to and including 610.<=
Different from (not equal)Copyfilter=VAT_Bus_Posting_Group ne 'EXPORT'Query on Customer service. Returns all customers with VAT_Bus_Posting_Group not equal to EXPORT.<>
endswithCopyfilter=endswith(VAT_Bus_Posting_Group,'RT')Query on Customer service. Returns all customers with VAT_Bus_Posting_Group values that end in RT.*
startswithCopyfilter=startswith(Name, 'S')Query on Customer service. Returns all customers names beginning with “S”.
substringofCopyfilter=substringof(Name, ‘urn’)Query on Customer service. Returns customer records for customers with names containing the string “urn”.
lengthCopyfilter=length(Name) gt 20Query on Customer service. Returns customer records for customers with names longer than 20 characters.
indexofCopyfilter=indexof(Location_Code, ‘BLUE’) eq 0Query on Customer service. Returns customer records for customers having a location code beginning with the string BLUE.
replaceCopyfilter=replace(City, 'Miami', 'Tampa') eq 'CODERED'
substringCopyfilter=substring(Location_Code, 5) eq 'RED'Query on Customer service. Returns true for customers with the string RED in their location code starting as position 5.
tolowerCopyfilter=tolower(Location_Code) eq 'code red'
toupperCopyfilter=toupper(FText) eq '2ND ROW'
trimCopyfilter=trim(FCode) eq 'CODE RED'
concatCopyfilter=concat(concat(FText, ', '), FCode) eq '2nd row, CODE RED'
dayCopyfilter=day(FDateTime) eq 12
monthCopyfilter=month(FDateTime) eq 12
yearCopyfilter=year(FDateTime) eq 2010
hourCopyfilter=hour(FDateTime) eq 1
minuteCopyfilter=minute(FDateTime) eq 32
secondCopyfilter=second(FDateTime) eq 0
roundCopyfilter=round(FDecimal) eq 1
floorCopyfilter=floor(FDecimal) eq 0
ceilingCopyfilter=ceiling(FDecimal) eq 1

War dieser Artikel hilfreich?

Ähnliche Artikel