how to implement an 'or' filter in ReferenceArrayInput - nestjs

please i want to implement an 'or' filter in ReferenceArrayInput
ex. parentId = 1 or null
anyone can help how can i do it
<ReferenceArrayInput
source="categoriesIds"
reference="categories"
label="Categories"
filter=???
>

Related

If Then Else in Infopath (Xpath): how to ?

I've a module in InfoPath / Sharepoint, a query field, and some fields.
I want to perform in formula a simple :
If (Condition) then
True Condition
Else
False Condition
In particular I want to write this formula:
If (FieldA = "") then
Get FieldB
else
Get FieldA
How to do in InfoPath formula ?
Thanks
If you want to use this as a default value, you can simply use the conditional default values. Therefor just use the following snippet:
(TrueResult | ElseResult) [(BoolCondition) + 1]
And in your case:
(FieldA | FieldB) [(string-length(FieldA) > 0) + 1]
For more information on this see:
https://blogs.msdn.microsoft.com/infopath/2006/11/27/conditional-default-values/

Cascaded Filter in spotfire

I am using cascaded filters in my reports and I have my expression like below -
if ([Region] = "${whichRegion}",[State],null)
along with the above expression, I would like to preselect one of the values of [state] column.
i would need some thing like this -
if ([Region] = "${whichRegion}",[State],null)
or
[State] = 'some default value'
I know above expression throws error.
Could you please let me know how the above expression can be modified ?
Just place your default state value in your false clause.
if([Region] = "${whichRegion}",[State],"DefaultStateValue")
BTW, where are you using this expression at?

Dynamic Spring #Query with principal and ternary operator

According to this https://spring.io/blog/2014/07/15/spel-support-in-spring-data-jpa-query-definitions I should be able construct a conditional query:
#Query("select o from BusinessObject o where o.owner.emailAddress like "+
"?#{hasRole('ROLE_ADMIN') ? '%' : principal.emailAddress}")
List<BusinessObject> findBusinessObjectsForCurrentUser();
What I'm trying to achieve is to change a larger part of a query. This is entirely synthetic example, but it demonstrates the idea:
#Query("select p from Project p where " + "?#{hasRole('ROLE_ADMIN') ? 'p.status='PRIVATE'':p.'status='PUBLIC''}")
public Page<Project> findAll(Pageable pageable);
The query above gives org.hibernate.hql.internal.ast.QuerySyntaxException: unexpected AST node: ? near line 1
I have tried different combinations with and without ?, ', :, # but still no luck. I suspect that it's either not possible due to the limitations of #Query or I misunderstand the syntax. Any help is appreciated.

Dynamic Linq and use of Between

I am having a Dynamic Linq where It should perform comparison between two integers. I tried so many but none of them worked for me.
Code
db.Bibs.Where(" Id >= 1 && Id<1000 ")
db.Bibs.Where(" Id between 1 && 1000 ")
How to form this string to make it work. Any suggestion will be highly appreciated.
Assuming this is SQL Server, it doesn't understand && use AND instead:
db.Bibs.Where(" Id BETWEEN 1 AND 1000 ")
http://weblogs.asp.net/scottgu/dynamic-linq-part-1-using-the-linq-dynamic-query-library

How to group "And" & "Or" in a single query statement using subsonic 2x

I am having some trouble in converting the following
SELECT * FROM foo f WHERE
(f.name = 'name' AND f.date = '1980/02/2001')
OR
(f.name = 'another name' AND f.date = '1990/02/2001')
to
new Select().From(Foo.Schema.TableName)
.Where(Foo.Columns.Name).IsEqualTo('name')
.And(Foo.Columns.Date).IsEqualTo('1980/02/2001')
.Or(Foo.Columns.Name).IsEqualTo('another name')
.And(Foo.Columns.Date).IsEqualTo('1990/02/2001')
as you can see I am not aware of the method which can isolate two groups of "AND" and put each of them in an "OR" statement.
I would really appreciate your help in this context.
You need to wrap the parts in barckets using the .AndExpression() and .CloseExpression()
See: http://biasecurities.com/2008/07/complex-sql-conditional-statements-with-subsonic-2-1/ for examples

Resources