Skip to main content
16-Pearl
November 24, 2020
Solved

Nested filter with data filter widget

  • November 24, 2020
  • 1 reply
  • 1843 views

Dear community,

 

I am uncertain about the capabilities of the data filter widget. The "ShowAdvancedOptions" flag lets me choose between "And" and "Or" but only on top level, no nested filters possible.

 

bbeuckSIG_0-1606209295513.png

In this example I would like to query

Timestamp greater than <date> AND

(

  EventId = 40 OR
  EventId = 99

)

 

I know that this is possible using code but having this option also available for the widget would be very convenient.

 

If this is not possible, what is the best workaround?

 

Used version is 8.4.4 if that is important by any means.

 

Thank you
Benny

Best answer by anarwal

@BennyB , I think such nested query can only be possible with service only.

 

Regards

Ankur

1 reply

anarwal5-Regular MemberAnswer
5-Regular Member
November 24, 2020

@BennyB , I think such nested query can only be possible with service only.

 

Regards

Ankur

BennyB16-PearlAuthor
16-Pearl
November 24, 2020

Hi Ankur ( @anarwal ),

 

that's a pity. Thanks for your reply.

 

Benny

BennyB16-PearlAuthor
16-Pearl
November 25, 2020

If anyone ever comes across this, here is my workaround.

 

Very often I use the DataTableEditor Mashup as it is the default for DataTables. I created a new ThingTemplate (let's say DataTableExt) deriving from DataTable and also a copy of DataTableEditor (DataTableEditorExt).

  • DataTableEditorExt has some additional widgets, including a text area to show the filter code. Whenever the data filter widget changes its value it updates the text area but it can also be modified manually. The text area is the actual input for the query Service.
  • DataTableExt has some additional Services, including "QueryToString" (data filter to text area) and "QueryDataTableEntriesString" which accepts a String instead of a query. This Service replaced the original QueryDataTableEntries in the mashup and is the source for the grid.

Unfortunately I cannot attach the entities since they contain company related names. But I am happy to answer questions if there will ever be one.

 

Regards
Benny