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

Question

Question

Issue with Search Repository Result Count Decision

asked on August 10, 2022

I wrote a workflow to query a SQL database, then do a search repository using the database fields. If the search finds documents, it goes down one path (found) and if it doesn't find anything, it goes down another path (not found). This is based on the search repository result count token. 

The issue that I'm having is that sometimes, the workflow isn't finding any files even when it should. If you manually search in Laserfiche (using the same search syntax but putting in the variable values and using a template search manually), you can find results, but the result count in workflow shows as 0. If I go back and run the workflow on one specific line that it said not found for when it should be found, it works as expected and goes down the found path. I also tried adding a second search once it said not found the first time, but that didn't help. And I tried a delay after each row to see if it was just trying to run to quickly, but that also did not work.

I'm not sure what to do at this point to get it to work. Any ideas/suggestions would be appreciated.

0 0

Replies

replied on August 10, 2022

You may not be getting a good value from the database query.  If you add Track Tokens to the end of the workflow, it will show you the information coming back.

1 0
replied on August 10, 2022

Hi Bill - I tried that as well, but the values look good coming from the database.

0 0
replied on August 10, 2022

In that case, the values may not be getting into your query. Can you show screen shots of the mappings (tokens => query fields) plus the token values you got back from SQL?

0 0
replied on August 11, 2022

I'm sorry, but I'm not sure what exactly you're asking to see. My query data step is below. The highlighted columns are the data point tokens that are being used in the search step.

Then in a For Each Row loop, I have this search repository step.

Here's a sample of the tokens from a previous run. I had to black out the acct number and name for security though. I'm not sure how to link the tokens though.

0 0
replied on August 12, 2022

The search query is the part I was looking for, it's where you use the values retrieved from the DB. Does it work manually with these exact values?

 

If not, I'd try using the For Each variable for the Date Open and Date Paid. You might also want to add the template to Suffix (i.e. [Loan]:[Suffix] vs. [Suffix]). Other than that, try removing elements from the Search Syntax until you find one that works.  Then you can add and test elements one by one.

0 0
replied on August 15, 2022

It does work if I put in a specific account number for the query step, even if it was one that had failed previously. It's a very strange issue because it works if I run it one row at a time, but if I run it for a batch of rows, it doesn't work for every row.

0 0
replied on August 15, 2022 Show version history

In that case, make sure all of the variables in the query are of the "ForEachRow_" type.

1 0
replied on August 15, 2022

Thank you so much! The Query Data tokens appear to be what was messing up my search and I hadn't even noticed that I used Query Data instead of For Each Row tokens! It is working now! Thanks again!

1 0
replied on August 16, 2022

You are very welcome - this is an easy mistake to make. The tell is that the first item in a list works, but none of the others work.  Or, nothing works but entering values manually works, the way you found.

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

Sign in to reply to this post.