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"}}









share|improve this question
























  • 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










  • 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















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"}}









share|improve this question
























  • 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










  • 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













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"}}









share|improve this question















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






share|improve this question















share|improve this question













share|improve this question




share|improve this question








edited Nov 14 at 9:27

























asked Nov 8 at 11:23









Maybe

121111




121111












  • 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










  • 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










  • 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

















active

oldest

votes











Your Answer






StackExchange.ifUsing("editor", function () {
StackExchange.using("externalEditor", function () {
StackExchange.using("snippets", function () {
StackExchange.snippets.init();
});
});
}, "code-snippets");

StackExchange.ready(function() {
var channelOptions = {
tags: "".split(" "),
id: "1"
};
initTagRenderer("".split(" "), "".split(" "), channelOptions);

StackExchange.using("externalEditor", function() {
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled) {
StackExchange.using("snippets", function() {
createEditor();
});
}
else {
createEditor();
}
});

function createEditor() {
StackExchange.prepareEditor({
heartbeatType: 'answer',
convertImagesToLinks: true,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: 10,
bindNavPrevention: true,
postfix: "",
imageUploader: {
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
},
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
});


}
});














draft saved

draft discarded


















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






























active

oldest

votes













active

oldest

votes









active

oldest

votes






active

oldest

votes
















draft saved

draft discarded




















































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.




draft saved


draft discarded














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





















































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







這個網誌中的熱門文章

Post-Redirect-Get with Spring WebFlux and Thymeleaf

Xamarin.form Move up view when keyboard appear

JBPM : POST request for execute process go wrong