Filtering users by custom field in Azure AD B2C Rest Api
up vote
0
down vote
favorite
In azure B2c directory I declared Boolean custom field named IsCommercial. Previously there were created users in directory. Now I am trying to get users filtered by IsCommercial custom field.
So if I trying to get users via Rest API where IsCommercial=true then it's working fine. But I can't filter users where IsCommercail=false or IsCommercial=null for previously created users. When IsCommercail=false it's returns nothing because all previously created user doesn't have a such custom field value, I understand that, but for IsCommercial=null it returns error.
So
filter = $"$filter={extendedProperty.Name} eq true";
working perfectly and return filtered data.
But when I am trying to get users without the custom attribut value:
filter = $"$filter={extendedProperty.Name} eq null";
it throw an error 'Internal server error'.
Is there a way to get users where extendedProperty value is null?
UPD:
I was trying Joy's solution:
filter = $"$filter={extendedProperty.Name} eq $false"
Still returns error, but now:
{"odata.error":{"code":"Request_UnsupportedQuery","message":{"lang":"en","value":"Unsupported Query."},"requestId":"018ebd6e-561e-4796-ad52-296ab792f968","date":"2018-11-14T09:23:18"}}
azure-ad-b2c azure-ad-graph-api
add a comment |
up vote
0
down vote
favorite
In azure B2c directory I declared Boolean custom field named IsCommercial. Previously there were created users in directory. Now I am trying to get users filtered by IsCommercial custom field.
So if I trying to get users via Rest API where IsCommercial=true then it's working fine. But I can't filter users where IsCommercail=false or IsCommercial=null for previously created users. When IsCommercail=false it's returns nothing because all previously created user doesn't have a such custom field value, I understand that, but for IsCommercial=null it returns error.
So
filter = $"$filter={extendedProperty.Name} eq true";
working perfectly and return filtered data.
But when I am trying to get users without the custom attribut value:
filter = $"$filter={extendedProperty.Name} eq null";
it throw an error 'Internal server error'.
Is there a way to get users where extendedProperty value is null?
UPD:
I was trying Joy's solution:
filter = $"$filter={extendedProperty.Name} eq $false"
Still returns error, but now:
{"odata.error":{"code":"Request_UnsupportedQuery","message":{"lang":"en","value":"Unsupported Query."},"requestId":"018ebd6e-561e-4796-ad52-296ab792f968","date":"2018-11-14T09:23:18"}}
azure-ad-b2c azure-ad-graph-api
Try to use$false
instead offalse
.
– Joy Wang
Nov 9 at 7:31
Does my solution work?
– Joy Wang
Nov 13 at 7:40
Unfortunately not. It returns 400 code with next body: {"odata.error":{"code":"Request_UnsupportedQuery","message":{"lang":"en","value":"Unsupported Query."},"requestId":"018ebd6e-561e-4796-ad52-296ab792f968","date":"2018-11-14T09:23:18"}}
– Maybe
Nov 14 at 9:24
add a comment |
up vote
0
down vote
favorite
up vote
0
down vote
favorite
In azure B2c directory I declared Boolean custom field named IsCommercial. Previously there were created users in directory. Now I am trying to get users filtered by IsCommercial custom field.
So if I trying to get users via Rest API where IsCommercial=true then it's working fine. But I can't filter users where IsCommercail=false or IsCommercial=null for previously created users. When IsCommercail=false it's returns nothing because all previously created user doesn't have a such custom field value, I understand that, but for IsCommercial=null it returns error.
So
filter = $"$filter={extendedProperty.Name} eq true";
working perfectly and return filtered data.
But when I am trying to get users without the custom attribut value:
filter = $"$filter={extendedProperty.Name} eq null";
it throw an error 'Internal server error'.
Is there a way to get users where extendedProperty value is null?
UPD:
I was trying Joy's solution:
filter = $"$filter={extendedProperty.Name} eq $false"
Still returns error, but now:
{"odata.error":{"code":"Request_UnsupportedQuery","message":{"lang":"en","value":"Unsupported Query."},"requestId":"018ebd6e-561e-4796-ad52-296ab792f968","date":"2018-11-14T09:23:18"}}
azure-ad-b2c azure-ad-graph-api
In azure B2c directory I declared Boolean custom field named IsCommercial. Previously there were created users in directory. Now I am trying to get users filtered by IsCommercial custom field.
So if I trying to get users via Rest API where IsCommercial=true then it's working fine. But I can't filter users where IsCommercail=false or IsCommercial=null for previously created users. When IsCommercail=false it's returns nothing because all previously created user doesn't have a such custom field value, I understand that, but for IsCommercial=null it returns error.
So
filter = $"$filter={extendedProperty.Name} eq true";
working perfectly and return filtered data.
But when I am trying to get users without the custom attribut value:
filter = $"$filter={extendedProperty.Name} eq null";
it throw an error 'Internal server error'.
Is there a way to get users where extendedProperty value is null?
UPD:
I was trying Joy's solution:
filter = $"$filter={extendedProperty.Name} eq $false"
Still returns error, but now:
{"odata.error":{"code":"Request_UnsupportedQuery","message":{"lang":"en","value":"Unsupported Query."},"requestId":"018ebd6e-561e-4796-ad52-296ab792f968","date":"2018-11-14T09:23:18"}}
azure-ad-b2c azure-ad-graph-api
azure-ad-b2c azure-ad-graph-api
edited Nov 14 at 9:27
asked Nov 8 at 11:23
Maybe
121111
121111
Try to use$false
instead offalse
.
– Joy Wang
Nov 9 at 7:31
Does my solution work?
– Joy Wang
Nov 13 at 7:40
Unfortunately not. It returns 400 code with next body: {"odata.error":{"code":"Request_UnsupportedQuery","message":{"lang":"en","value":"Unsupported Query."},"requestId":"018ebd6e-561e-4796-ad52-296ab792f968","date":"2018-11-14T09:23:18"}}
– Maybe
Nov 14 at 9:24
add a comment |
Try to use$false
instead offalse
.
– Joy Wang
Nov 9 at 7:31
Does my solution work?
– Joy Wang
Nov 13 at 7:40
Unfortunately not. It returns 400 code with next body: {"odata.error":{"code":"Request_UnsupportedQuery","message":{"lang":"en","value":"Unsupported Query."},"requestId":"018ebd6e-561e-4796-ad52-296ab792f968","date":"2018-11-14T09:23:18"}}
– Maybe
Nov 14 at 9:24
Try to use
$false
instead of false
.– Joy Wang
Nov 9 at 7:31
Try to use
$false
instead of false
.– Joy Wang
Nov 9 at 7:31
Does my solution work?
– Joy Wang
Nov 13 at 7:40
Does my solution work?
– Joy Wang
Nov 13 at 7:40
Unfortunately not. It returns 400 code with next body: {"odata.error":{"code":"Request_UnsupportedQuery","message":{"lang":"en","value":"Unsupported Query."},"requestId":"018ebd6e-561e-4796-ad52-296ab792f968","date":"2018-11-14T09:23:18"}}
– Maybe
Nov 14 at 9:24
Unfortunately not. It returns 400 code with next body: {"odata.error":{"code":"Request_UnsupportedQuery","message":{"lang":"en","value":"Unsupported Query."},"requestId":"018ebd6e-561e-4796-ad52-296ab792f968","date":"2018-11-14T09:23:18"}}
– Maybe
Nov 14 at 9:24
add a comment |
active
oldest
votes
active
oldest
votes
active
oldest
votes
active
oldest
votes
active
oldest
votes
Thanks for contributing an answer to Stack Overflow!
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Some of your past answers have not been well-received, and you're in danger of being blocked from answering.
Please pay close attention to the following guidance:
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53206766%2ffiltering-users-by-custom-field-in-azure-ad-b2c-rest-api%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Try to use
$false
instead offalse
.– Joy Wang
Nov 9 at 7:31
Does my solution work?
– Joy Wang
Nov 13 at 7:40
Unfortunately not. It returns 400 code with next body: {"odata.error":{"code":"Request_UnsupportedQuery","message":{"lang":"en","value":"Unsupported Query."},"requestId":"018ebd6e-561e-4796-ad52-296ab792f968","date":"2018-11-14T09:23:18"}}
– Maybe
Nov 14 at 9:24