Our monthly Virtual Happy Hour is happening this week, Fri Feb 23!

Try our conversational search powered by Generative AI!

How to query user by conditon same property has different values, e.g. GivenName = 'a' or GivenName = 'b'


I know how to query if the condition is GivenName = 'a' or SurName = 'a'.

But how can I query users by condition GivenName = 'a' or GivenName = 'b'?  UserQuery can only set one Criterion on one property, currently I have to query many times then add them together. If I can query only one time, it save lot of time.

Does anybody have idea?

Nov 29, 2012 22:15

I think you should be able to use the StringInCriterion, something like:

var uq = new UserQuery();
uq.GivenName = new StringInCriterion();

I haven't tried this and I might not remember correctly how to use it. But something like it may work.

Nov 30, 2012 8:49

Hi Magnus, thanks for you answer

What should be used is "Includes"

uq.GivenName.Includes = new StringInCriterion();

Thanks again.

Dec 03, 2012 11:28

Ah, yes of course, I forgot that level. I suppose it would have been obvious if I had actually tried to assign it :)

Dec 03, 2012 13:05
This thread is locked and should be used for reference only. Please use the Legacy add-ons forum to open new discussions.
* You are NOT allowed to include any hyperlinks in the post because your account hasn't associated to your company. User profile should be updated.