YannickRe / spfx-msgraph-peoplesearch

Show and search users from your organization with an SPFx web part, through Microsoft Graph.
40 stars 33 forks source link

Use substr in $filter query #2

Closed YannickRe closed 3 years ago

YannickRe commented 3 years ago

I’m struggling with another problem of the webpart (or even more with the odata request). I would like to use substring of in the $filter parameter, but unfortunately it’s not working (-> invalid filter clause).

What I’m trying to to is: $filter: substring(‘OÖ’, department) What’s working: $filter: department eq ‘LD OÖ’

Do you have any information what I should use for using substring?

Thanks a lot and best regards, Evelyn

YannickRe commented 3 years ago

Hi @hamev,

I split off your second question into a separate issue, it helps me manage the conversation.

As far as I can see it is not supported to use substr in $filter, while using Microsoft Graph. It's a bit difficult to figure out what is supported and what not, but it is basically combining the generic info about $filter with the properties of users that are supporting $filter.

I hope you can figure out a filter that can work for you.

naturelgass commented 3 years ago

I’m struggling with another problem of the webpart (or even more with the odata request). I would like to use substring of in the $filter parameter, but unfortunately it’s not working (-> invalid filter clause).

What I’m trying to to is: $filter: substring(‘OÖ’, department) What’s working: $filter: department eq ‘LD OÖ’

Do you have any information what I should use for using substring?

Thanks a lot and best regards, Evelyn

If found that the startswith string operator is supported, so you can search e.g. by the first letter like this: startswith(displayName,'A')