Hot answers tagged

43

Try using 1 for true, 0 for false. I was able to replicate your problem in SPO, but using 1/0 worked fine: /_api/web/lists/getbytitle('BtProjects')/items?$filter=Active eq 1


32

As far as I know, you can not use &. You have to use and or or inside the filter. So try using something like that: /_api/web/lists/getbytitle('Students')/items?$select=Title,ZIP&$filter=((ZIP eq 12345) or (ZIP eq 22222)) I always use brackets because of the readability, but you can also use it without brackets. items?$select=Title,ZIP&$...


27

How to retrieve document name using SharePoint REST Since FileRef contains file name, you could utilize the following query to return document names: Endpoint: /_api/web/lists/getByTitle('<list title>')/items?$select=FieldValuesAsText/FileRef&$expand=FieldValuesAsText Example Get documents (names) that have been created from 2014 year: /_api/...


25

It does not seem possible to filter list items using FileSystemObjectType property in SharePoint 2013 REST. Option 1 But you could utilize the following REST query to return folders and associated list items: /_api/web/lists/Lists(guid'GUID')/rootFolder/Folders?$expand=ListItemAllFields JavaScript example var listTitle = "Documents"; var url = "/_api/...


17

I can't really provide a sensible answer to why this is happening (I can confirm I'm experiencing the same weird behavior. I'm sure this is related to the fact that they cut out the designer part without properly thinking about the consequences this would have had). What I can offer is a dirty workaround that proved to be almost always working in my case. ...


12

Have you tried using [today]-180?


11

FileLeafRef: /_api/web/lists/getByTitle('list')/items?$select=FileLeafRef File Name: /_api/web/lists/getByTitle('<list title>')/items?$select=File/Name&$expand=File Also, for querying a document library by Name of document, use below: /_api/web/lists/getByTitle('Doc Library Name')/items?$select=FileRef&$filter=substringof('Test Document ...


9

In the Filter settings of a View you can only use [Today] as is, you can do simple +- calculations but you can not use Functions. Remember: Do not add spaces in your View Filter calculations: [Today]-7 So you need to add two Calculated Columns calculating january1st =DATE(Year([YourDate]),1,1) and december31st =DATE(Year([YourDate]),12,31) and then ...


8

SharePoint List Filter web part is rendered as input text field for displaying filter value: <input type="text" readonly="readonly" id="{ClientID}_SpListPicker_SelectionBox" title="Selected values" > and input hidden field for storing filter value: <input type="hidden" id="{ClientID}_SpListPicker_Selection" value="{FilterValue}"> Below are ...


8

You can create/modify a view and apply the filter on the start date. To create/modify a view, go to list settings-> Scroll down to bottom and you will see a section named Views. Here you can click on exiting view or create a new view. In the view you can filter based on the start date in the Filter Section. UPDATE Based on your update in the question. This ...


8

You need to activate SharePoint Server Enterprise Site collection features(the one at Site collection level). Go to site settings > Site collection features and activate it.


8

SharePoint REST API endpoints take ISO formatted date string for filtering. Try using below query for filtering on Date Field: To check greater than 2018/10/05: https://[tentat]/sites/[site]/Normativo/ComunicacoesDeNegocio/_api/web/lists('e97f928b-34e4-34e2-c2c7-150ea469fac3')/items?$select=ID,Title,Created,QuemLeu/Id&$expand=QuemLeu&$filter=(...


7

To the best of my knowledge the REST API does not support OData filters on null date values. There is an MSDN forums post with someone having the same issue and a member of the SharePoint team mentions that it is a known issue and they are working on it. The current implementation of REST does not support null values for filtering on list item queries. ...


7

To return files use: _api/web/lists/getbytitle('Documents')/items?$filter=startswith(ContentTypeId, '0x0101') To return folders use: _api/web/lists/getbytitle('Documents')/items?$filter=startswith(ContentTypeId, '0x0120') I have tested this against SP2013 Online (O365), it should work against SP2010 as well. This works against all child content types as ...


7

If you have a SharePoint task list where the task is assigned to a SharePoint group, you may notice that the My Task list does not show tasks even if you are a member of the group of which the task is assigned. Fortunately, there is a simple fix. It does require SharePoint Designer though. Open SharePoint Designer and then open the My Tasks view of the ...


6

It is possible to accomplish with OOTB Metadata Navigation and Filtering Feature using Navigation hierarchies control. Navigation hierarchies control allows to select an item in a hierarchy for a managed metadata column with filter for single Term Term with descendant child terms Applying filter in Navigation hierarchies control corresponds to ...


6

Re the problem raised by lwbecker2, so long as you have an additional lookup column that is based on the full lookup list (ie not the 'filtered' column) then you will be able to still see the original department in the linked list. For example, Department linking to the column ActiveTitle will be blank but Department:Title will still have the original ...


6

You are missing ID in expand. The query should look like: _api/Web/Lists(guid'id')/items?$select=Id,Author/ID&$expand=Author/ID&$filter=(Author/ID eq 21)


6

Actually, at least on SharePoint 2007, when you're using the GUI, your filters are going to be applied and grouped in the order they were entered, ignoring the "AND before OR" rule. So, in your case: 1 || 2 && 3 && 4 will be treated like: ( ( 1 || 2 ) && 3 ) && 4 <=> ( 1 || 2 ) && 3 && 4 Which would ...


6

You need to add two calculated columns that will work out the start and the end of the month. (This example uses [Due Date] but you can use any date/time column) "Start of Month" =DATE(YEAR([Due Date]), MONTH([Due Date]), 1) "End of Month" =DATE(YEAR([Due Date]), MONTH([Due Date])+1,1)-1 Then you setup a filter in your view for... "Start of ...


6

It is a limitation in SharePoint 2013 REST filter. You need to use CAML query along with REST. url: "/_api/web/lists/getbytitle('Sponsors')/getitems" method: "POST", body: "{ 'query' : {'__metadata': { 'type': 'SP.CamlQuery' }, "ViewXml": "<View><Query><Where><BeginsWith><FieldRef Name='URL'/><Value Type='URL'>url</...


6

I guess the REST filter does not support Null filtering. The current implementation of REST does not support null values for filtering on list item queries. But as this is a desirable feature, there is a bug tracking it and we are discussing on when we add this support. You can find full description and workaround here Based on the SharePoint ...


5

You can simply achieve this by using webpart connections. Let's say you already have a webpart page with the two webparts, one below the other, and there is a lookup column in the employees list to the department list, as you said in your question. You just have to edit your web part page and select from the webpart dropdown menu Connections-> Send Row of ...


5

Using following CAML Where clause <Where> <And> <And> <Neq><FieldRef Name="DocIcon"/><Value Type="Computed">docx</Value></Neq> <Neq><FieldRef Name="DocIcon"/><Value Type="Computed">pptx</Value></Neq> </And> <Neq><FieldRef Name=...


5

To query any person or group field against logged in user you can use **<UserID/>** tag in Value. if (!Page.IsPostBack) { using (SPSite mySite = new SPSite(SPContext.Current.Web.Url)) { using (SPWeb myWeb = mySite.OpenWeb()) { ...


5

There are no other options as such. but you can use calculated columns as an alternate solution which will have most of the excel based features.


5

You have to use person/group field is equal to [Me], not contains. Even if the person/group field contains multiple users, it will still filter correctly when using is equal to [Me].


5

Something along the lines of this: /_api/Web/Lists/getbytitle('Users')/items?$filter=Age ge 50 and Age le 100


5

Apologies for previously erroneous and misleading answer This is known issue. You cant filter data on rich text fields using $filter. It is present on 2013 On Premise and SharePoint online as well. Doesnt matter if its plain text or enhanced rich text, this is unfortunately not allowed. I believe it could be for performance reasons. So you need to use it ...


5

This is the limitation of REST API Filter that it cannot filter the Hyperlink fields. So whats the workaround? You can use CAML with REST to achieve what you want. The CAML query will be like: <View><Query><Where><Eq><FieldRef Name='URL'/><Value Type='URL'>url</Value></Eq></Where></Query></...


Only top voted, non community-wiki answers of a minimum length are eligible