You are viewing limited content. For full access, please sign in.

Question

Question

Filter Expression

asked on September 28, 2013

Dears,

 

I'm trying to find a documentation for Filter Expression, Please give me a link for any document contains more details than Admin guide.


 

Thanks in advance.

 

0 0

Answer

APPROVED ANSWER
replied on October 1, 2013

Hello Maged,

 

We have two resources for filter expressions. The first is the "Filter Expression Syntax and Examples" page in the Laserfiche Administration Guide help files. More information about filter expression syntax can be found in the developer notes, which are kept on the Support Site.

0 0

Replies

replied on October 2, 2013

One thing I would like to mention is that folder filter expressions, even very simple ones, have a very negative impact on performance. If at all possible, ACLs and security tags should be used to enforce access controls and folder filter expressions should be considered a last resort.

0 0
replied on July 28, 2014 Show version history

Will filter expressions support tokens.  For example, if I have a field named "Access_Username" (multivalue) and want the login user to be able to access documents with that field filled in with his/her username, what would the expression be???  The Admin help files aren't very informative on the use of token's in the expressions.  If they do support them, what is the syntax?  I am using:

 (IS_GROUP_MEMBER('Habeas Defense Attorney') = 1) AND ANY entryprop."Access_Username" = 'username'

The token for 'username' doesn't seem to work, nor does the "ANY" operator.  With "ANY" it in the string, the expression isn't accepted into the properties field.

 

0 0
replied on July 28, 2014

I'm not sure how to answer your question about tokens.  As the admin guide shows but does not call particular attention to in a couple of its examples, you can use

CONTEXT('username')

to stand in for the name of the current user.

 

As for "ANY", if I'm reading the dev notes correctly, it can only be applied to an expression on the right-hand side of a relational operator, so you'll have to construct your field-matching clause like so:

CONTEXT('username') = ANY entryprop."Access_Username"
0 0
replied on July 29, 2014

For the expression,  I am using

"(IS_GROUP_MEMBER('Habeas Defense Attorney') = 1) ANY .entryprop."Access_Username" = 'username'

 

so that if that user is in the group "habeas Defense Attorney" and the user's name is in the template field called "Access_Username", which is a multivalue field, it should work.  But when I try to save I get the message:  " Invalid filter expression: missing characters or bad format.   If I use a "AND" instead of "ANY", it takes it but doesn't allow the user access.  

 

By the way, I get the same message if I use "AND ANY" like it says in the admin guide, even when I don't use a group, just a user.

(context ('username') = 'test' AND ANY entryprop."Access_username" = 'username')

0 0
replied on July 29, 2014

The example in the admin guide is incorrect.  It should instead be

 

(context ('username') = 'UserName' AND 'FieldValue' = ANY entryprop."FieldName")

 

I've requested that this be fixed.

 

In your case, it looks like you want

(IS_GROUP_MEMBER('Habeas Defense Attorney') = 1) AND context('username') = ANY entryprop."Access_Username"

which should check for membership in the 'Habeas Defense Attorney' group and also check whether any value in the "Access_Username" field matches the name of the currently logged-in user.

0 0
replied on August 1, 2014

That did it.  Thanks for your help.

0 0
You are not allowed to follow up in this post.

Sign in to reply to this post.