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

Question

Question

search within a search in workflow

asked on May 16, 2014

 

I created a workflow to search for a case number folder based off of the case number from a document.  Folder is found.  Now what I want to do is search within that found folder for a document named the same as the original document the search was created from.  If it is found...join them.  If not put it in the folder.

 

I am having problems trying to get the second search to complete.  It seems when I use the search function again it locates all the documents with the same name from all the folders.  I tried to figure out how to use tokens... no luck.  Is there a simpler way to do this in workflow?

0 0

Answer

SELECTED ANSWER
replied on May 20, 2014

Here's what I've been trying to do (look for a folder name=value in template) and then search for a document with the name of "court docs".  But the results keep coming back with 0.  When I do a search individually in LF I get results for both but combining them I get nothing.  Am I somehow transposing info into the query correctly.  I've used DB and DBS.  You are using LOOKIN where I am searching....

 

{LF:Name="%(RetrieveFieldValues_Cause Number)", Type="FS"} & {LF:Name="court docs", Type="DBS"}

 

To finish things off, in the first result location....if results = 1 I would move pages (combine them)  and if the result = 0 I would route the entry to the first result location folder. 

 

 

 

 

0 0
replied on May 20, 2014

Bonnie, your search looks for an entry that is both a folder and a document and has 2 different names. There is no way to search for a document whose parent folder's name you get from a template value. You either need the whole path for the LOOKIN search or you need to find the folder by name first and then look at its documents separately (either with Find Entries or by using the folder's path in a LOOKIN search).

0 0

Replies

replied on May 16, 2014

Hi Bonnie:

 

Let me ask you a quick question, is the information pulled for the folder search from a metadata field off of the document? So in other words, are you pulling the case number from a metadata field or is it the exact name of the document?

 


Tony

0 0
replied on May 16, 2014 Show version history

As Tony said it depends on what you are searching on.  Templates, fields, document names, etc.  Assuming that you are doing a search based off the document name I would do a simple document folder and document name search.  

 

The advanced search syntax you should be able to use would be something like this:

 

{LF:Name="%(EntryName)", Type="DB"} & {LF:LOOKIN="\Case Files\%(EntryName)"}

 

Now I have not tested this but this search should look only in a folder called whatever your document name is and then for a document with that same name.  It should work.

 

Now if you are doing a field search or something else then replace the EntryName token with the appropriate substitute.  

 

Then you have a routing choice.  If you search found something, move the pages to the found document.  If you did not find anything just move the document.

 

0 0
replied on May 19, 2014

We have a master court case number 11-1-11111111.  We have a document called COURT DOCS.  What I want to do is search for the master court case number folder.  If it is found then I want to search again to see if it already has a document called COURT DOCS and join them.

0 0
replied on May 19, 2014

Then the search syntax listed above is going to be correct.

 

{LF:Name="%(Entry Name)", Type="DB"} & {LF:LOOKIN="Case Files\11-1-1111111"}

 

Note the stuff before the \11-1-11111111 is going to be different depending on how your repository is setup.

 

You would scan or import the document Court Docs.  When that happens the Workflow triggers.  It runs the above search using the Court Docs name and searches the 11-1-11111111 folder for it.  Then there will be a decision.  See the diagram above.  If it find the document, it moves the pages.  If it does not, simply move the document.

0 0
replied on May 19, 2014

Bonnie,

 

Chris's option looks perfect for what you're looking to do... should read something like this:

 

Search for Case #

If Result count of Search for Case # = 1

Search for Document named "COURT DOCS" inside of "Search for Case #_FirstResult"

 

If Result count of search for "COURT DOCS" = 1

use "move pages" activity to combine with new "COURT DOCS"

 

Is Result count of search for "COURT DOCS" = 0

use "Route Entry to Folder" to simply put the new "COURT DOCS" in the folder.

 

There's an alternative using Find Entries, but I would stick with the search....

 

 

Tony

 

0 0
replied on May 19, 2014

thank you... I will test it and let you know the results.

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

Sign in to reply to this post.