Perform 'Is one of' filter using Dynamics365 Odata filter - filter

When filtering in fields on D365, we have the filter option of 'is one of' which is more like SQL's where in clause. I'm trying to perform such filter operation using Odata but can't find the right way. Lambda has an any and all but don't know how to throw in a list to compare against.

Try using the In Function.
?$filter=Microsoft.Dynamics.CRM.In(PropertyName=#p1,PropertyValues=#p2)&#p1='name'&#p2=['value','value']
The full list of filter's.

Related

How to add filter to a custom query on Data Studio?

I'm building a dash using Data Studion and I need to create a custom query using CASE WHEN statments. The problem is that the conditions must be the values selected through a filter. How can I get the value selected on the filter and use it as a parameters on my query?
you can not , the only parameter that can be passed from a filter is dates as per this documentation https://support.google.com/datastudio/answer/6370296?hl=en
all you can do is vote for this feature request
https://issuetracker.google.com/issues/142183085

Graphql Inline Fragments search options

So i am using graphql feature in Orchard to get data from the events type,
each eventsItem has a bag of Event as it shows the image bellow
So the problem is that i need to fetch an event with its "contentItemId",is there a way to add where clauses in an inline Fragment.
Fragments are just a way to specify the selection set (i.e. fields) by type at runtime. They are not a way to filter results. GraphQL does not provide any built-in way to filter, sort or otherwise mutate the results -- it's up to each individual service to implement those features. If the schema doesn't expose any argument on the events, bag, or contentItems fields to let you do the sort of filtering you're trying to do, then it's not possible to do so through a query.

Using aliased expression used in select clause into my order by clause for a criteria query

I have a requirement which is somewhat similar to this. My API supports a filter where there is more than 8 filter parameter. So, I want to create a query dynamically based on the filter parameter passed. I am using CriteriaBuilder to create a dynamic query.
Now, I am able to create dynamic queries successfully but the issue comes when the user wants to sort on an aggregate functions. In my query, I have 4 aggregate (count) function. So to support sorting on these columns, I just use the expression of this aggregate function but what I want is to use the alias of this expression
Repeating the expression in select and order by doesn't seem right to me. So, is there a solution/workaround to the problem. I want to declare the expression alias once and use it in both select and order by clause and if required in my group by clause in future
You probably need to build a custom projection class, you can find a decent and easy one, SQLProjectionWithAliasSupport in https://hibernate.atlassian.net/browse/HHH-2952 (from Sergey Pulyaev)
If then one wants to support also sub criteria, things get more complicate

How To Handle Pagination And Ordering In Cypher Query?

I am writing a cypher query in neo4j that merge few seperate queries with'UNION' operator. Now, the final result need to be sorted according to a specific column and I also need to be able to use 'LIMIT' to the final result so that I can fetch based on pagination request.
How to achieve that? adding 'ORDER BY' or 'LIMIT' at the end doesn't seems to work. Can't find a way to wrap the result as temporary set(as in sql queries) either. Any suggestions?
Currently it is not possible to add a ORDER BY or SKIP/LIMIT clause to the global set of UNION.
This is a pending feature request, see https://github.com/neo4j/neo4j/issues/2725
Maybe you can share your query and we can find a way to do it without UNION ?

Exact match on some fields and "fuzzy" search on others?

I am attempting to create a query to exactly match on a few fields, such as account_id and from_addresses (which is an array), while also fuzzy matching on another field such as message_content. What is the best way to do this?
I have tried a Bool query with a few must and should parameters but can't seem to get it working.
I believe what you want to do it to use Filters. More specifically, an AND filter. So your query message_content, but filter by account_id and from_addresses.
I don't know which library you are using, so I can't really provide any code examples.

Resources