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

Discussion

Discussion

How can I search for all documents that are missing a field?

posted on March 6, 2015 Show version history

I am attempting to use Advanced syntax to create a search that looks for all documents in a particular folder area that have an empty/missing field. I know I could do a more broad search, view the results in the client and sort by that column to find the blanks. However, I am trying to plug this in to a Workflow so it can automatically fill them in with data it will get somewhere else.

My syntax looks something like this so far:

{LF:Name="*", Type="DB"} & {LF:LOOKIN="\RepositoryName\Test Folder\"} - {[]:[Case Number]="*"}

I thought that would get me all of the documents in that folder area without a Case Number, but that doesn't seem to work.

Using this example, what would the correct syntax be to find all of the documents that do NOT have a Case Number on them?

Also -- what I do not want to do is loop through every document in this folder with a conditional sequence that fills in the field if it is blank. There are hundreds of thousands of documents to loop through, so that would make this take too long. I need to keep my search result set smaller.

1 0
replied on March 9, 2015

Alright folks - amateur mistake here.

After editing the advanced syntax to change the & to aI was not closing the other search windows. This likely resulted in Laserfiche looking for both - {[]:[Case Number]="*"} as well as & {[]:[Case Number]="*"}

Sorry about this, and thanks for everyone's input!

0 0
replied on March 8, 2015 Show version history

I think you all are starting to realize my dilemma.

There are 500,000 documents in a repository I am working on that do not have a template assigned to them. Before I can assign the template I want, they have certain required fields that need to be filled in. I cannot possibly fill in all of the required fields on all of the documents in one Workflow run for a couple of reasons:

  • Search Repository can't handle more than 10,000 entries at one time.
  • I know that some of the documents will not be able to have the Case Number inferred and filled in automatically, due to a variety of circumstances surrounding the logic I am using to fill them in.
  • Each time I run "Search repository" I don't want it to find the entries that this Workflow has already filled in.
  • Since there is no template on these documents, the Case Number field is also not on them. But it is on some already, so I can't just search for all Case Numbers and give it some bogus value, then go back and fill it in with something else.

 

This is why I would ideally be able to search for all of the documents in a given folder area, that do not have this field on them at all. Since the documents also don't have the template on them, there appears to be no way to run this search.

0 0
replied on March 8, 2015

What is the issue you're having with

[MySearchTerm] - {[]:[Case Number]="*"}

I'm using Laserfiche 9.2 and the above search (if for example my search term is just for all documents in a particular folder) will give me results containing documents with no template, documents with a template that doesn't have the Case Number field, and documents that have a template with the Case Number field, but that field empty.

If you can describe in detail what's not working with that search, i.e. what documents are being returned, but shouldn't be returned, or what documents are not being returned that should be returned, then we can provide more suggestions. Also, you can try opening a support case if the matter needs to be investigated further, i.e. if this is something specific to the customer's scenario. Are you able to recreate the issue in your VAR Kit?

1 0
replied on March 6, 2015

If the entry has no template assigned (or has been assigned a template that doesn't use that field) then using

[MySearchTerm] - {[]:[Case Number]="*"}

should work. Note that you can't add an independent field with a blank value.

What is the issue you're having with the above search term?

1 0
replied on March 6, 2015 Show version history

I just built a quick test for this and my workflow is able to find the correct document (the one with a blank field). I made the workflow very basic for testing:

LF Search: {[]:[Case Number]=""} & {LF:LOOKIN="AOPA\Sandbox"}

The next activity applies a stamp to the document returned in the search.

When I ran it, the stamp was applies to the document in which the "Case Number" field was blank.

 

Screenshots:

LF Client showing fields. Doc 2 has blank Case Number field:

 

Document after running test workflow that applied the stamp to the document returned in the search results (Doc 2):

 

Doc 1 (that has a case number) did not get a stamp applied.

So it seems to be working for me. Maybe try to simplify your search? I didn't specify a name of a document. I just searched the entire folder location.

Actually... looking back at your syntax, I think including {LF:Name="*" in your search might be the problem. You are essentially asking the search to return "all" documents with any name. So the Field search parameter is probably being ignored. Trying removing that parameter from your search.

0 0
replied on March 6, 2015

Side note: this only works if the field is part of a template assigned to those documents. It won't work if the field is assigned by itself outside of a template.

1 0
replied on March 6, 2015

How can you have a blank field linked to a document that is not part of the template assigned to the document? I just tried to do that and couldn't. I added a field to the document but when I saved the document, the blank field was removed.

0 0
replied on March 6, 2015

You are correct that you can't have blank independent fields. I was pointing out if this search is meant to find documents were the field was not yet assigned as an independent field, it would not work.

0 0
replied on March 6, 2015

Strange, I can't seem to flag your answer as "the answer" anymore.

replied on March 6, 2015

That's because this thread has been opened as a discussion, not a question.

replied on March 6, 2015

Ah, woops!

replied on March 6, 2015 Show version history

Actually, this appears to give me all results *except* the ones that are empty, which is what I was trying to avoid.

Doing the reverse...

 {LF:Name="*", Type="DB"} & {LF:LOOKIN="\RepositoryName\Test Folder\"} & {[]:[Case Number]=""}

Doesn't show anything, because these documents do not have the field on them at all (no template assigned).

Any additional thoughts?

0 0
replied on March 6, 2015 Show version history

Did you try not having anything between the quotes in your field parameter?

When I use this syntax in my repository, I find all documents that the Application Number field is blank:

{[]:[AAF - Application Number]=""}

 

So your revised syntax should just be:

{LF:Name="*", Type="DB"} & {LF:LOOKIN="\RepositoryName\Test Folder\"} - {[]:[Case Number]=""}

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

Sign in to reply to this post.