Summary: Fix the EL expression returned when using the NXQL IN operator and the list returned by the EL is empty
I have a multivalued string field, activity:issues
It contains references (uid) to documents (IssueDocument) and is filled using the "multiple document suggestion" widget.
Then in another place (a tab) I need to display the list of issues in a content view. The NXQL filter for this content-view is just:
The parameter is:
This works only if the filed is not empty (not null probably, for example when a new document is created). If it is empty, an error is displayed:
=> We can see the expression returned just () instead of ('') with the quotes.
So I added a condition to the parameter:
The problem is that it still doesn't work if the list is empty. Like if at runtime, the parenthesis were removed:
I tried by changing the filter to add the parenthesis:
But then the error is displayed when there is at least one value, because the expression adds the parenthesis too so we have "((":
The workaround found is about having an activity:issues_empty multivalued string field. For "about to create document" event, this field is filled with an empty string. Then, the ternary operator in the EL returns this field: