Not logged in. · Lost password · Register
Forum: General Help and Support Plugins RSS
Struct: How to filter for empty values
Mfu #1
Member since Feb 2018 · 2 posts · Location: Bavaria, Germany
Group memberships: Members
Show profile · Link to this post
Subject: Struct: How to filter for empty values
Hi All,

Situation: you have articles where not all struct fields were filled (e.g. because they are not mandatory, or the field was added later).

When using a simple table view without a filter, records with an empty field show up.

---- struct table ----
schema: metainfo
cols: %pageid%, Status, Author(s), %lasteditor%, %lastupdate%
rownumbers: 1
csv: 0

I struggle in filtering fields without a value

This works:
filter: Status ~ * --> shows all records /articles with a value in the status field

This does not work:
filter: Status !~ *  --> the records with the empty field value are not displayed.

filter: Status !~ 1* -> works (the values in the field start with 1 .., 2..., 3... etc) all values that do not start with 1 are displayed.

My questions:
- Am I using the wrong comparator? Should I go with a reg-ex one? 
- Is there a special "empty" string symbol like "" ?
- Bug or feature?

THX for sharing your experience/ideas.

rkaa #2
Member since Jun 2019 · 6 posts · Location: Norway
Group memberships: Members
Show profile · Link to this post
Brand new to struct here, but I think it's the comparator. Something like this should work:

---- struct table ----
schema: metainfo
cols: %pageid%
filter: Status <=0
csv: 0

If the field name is actually lowercase, and only the Title label is uppercase,
Not sure if aggregations are case sensitive. They ought to be..
Meaning if your field is actually called "status" (and only the Title/label is "Status"):

filter: status  <=0

Tested in struct, seems to work.


This approach didn't work when looking for empty mail fields in "structured data plugin".
The solution was a work-around:

filter: something_mails !~ *@*

Kind regards;
Close Smaller – Larger + Reply to this post:
Verification code: VeriCode Please enter the word from the image into the text field below. (Type the letters only, lower case is okay.)
Smileys: :-) ;-) :-D :-p :blush: :cool: :rolleyes: :huh: :-/ <_< :-( :'( :#: :scared: 8-( :nuts: :-O
Special characters:
Go to forum
This board is powered by the Unclassified NewsBoard software, 20150713-dev, © 2003-2015 by Yves Goergen
Current time: 2020-02-29, 05:57:49 (UTC +01:00)