2

I need get all users with a custom property using sharepoint search api, this custom property already mapped in sharepoint.

I'm using this url, and this retrieves all users

http://localsite/_api/search/query?querytext='*'&sourceid='B09A7990-05EA-4AF9-81EF-EDFAB16C4E31'&rowlimit=5&selectproperties='PreferredName,WorkEmail,PictureUrl,Title,Departament,Birthday,Url'

But i need get all users with filtering by custom property Birthday, example, Sep/1 to Sep/31

How should I do

6

For a specific date:

&refinementfilters='Birthday:datetime("2000-06-25")'

For a range (a month in this example)

&refinementfilters='Birthday:range(datetime("2000-06-01"), datetime("2000-06-30"))'
  • I have no idea about this but if your solution is correct then this can be used: &refinementfilters='Birthday:range(datetime("1850-09-01"), datetime("2050-09-31"))' – Amit Bhagat Aug 20 '13 at 10:49
2

When using the refinementfilter make sure the Managed Property 'Birthday' is configured as Refineable in the Search schema.

0

Need to match only date and month. But the above example works fine for exact match including year.

&refinementfilter='Birthday:datetime("1970-08-07")'  

It's retrieving the record of exact match(no different year records like 1978-08-07 are not retrieved)

0

Using angular js and add this modules SennitShareAngularJs.

Use Example:

'use strict';
app.controller('birthDayUsersController', ['$scope', 'sennitRestApi',  function ($scope, sennitRestApi) {

    $scope.birthdays = ([]);

    //Capture all Users birthday of the September
    $scope.birthdays = sennitRestApi.getMonthBirthDayRange('2000-09-01', '2000-09-31');

}]);

https://github.com/buenokinder/SennitShareAngularJs

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.