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

Question

Question

Workflow Custom SQL Activity for LIKE Search

asked on November 2, 2020 Show version history

Good Morning Laserfiche Community,

 

I am having some issues creating a custom SQL query and am looking for help.  The issue I am having is that I need wild card characters before and after the token value.

Using the custom SQL query activity I can get results if I am only looking for the field value to start with the token value by using %(tokenvalue)%, but %%(tokenvalue)% does not return any results.

The situation is that I am receiving values from another program through an API.  The values passed by the API do not always match the values the customer wants on the Laserfiche template.  So I have a SQL table that has the values for the template in one column and the values from the API in another column.

I need wild card characters before and after the token because the accelaValue column (the values coming from the API) can be multiple values.

So in the screen shot, I can make a search work for T104 R14% but a search for %T104 R15% returns no results even though you can see it is the start of my second value.

How do I get the query to use wild characters on both sides of the token?

The first shot is out of SQL Server showing the query works.  The second shot is workflow without the front wild card character.

WorkflowSQLLike.jpg
WorkflowSQLLike2.jpg
0 0

Replies

replied on November 2, 2020

Thanks for the super quick response Miruna!  I think I found my issue.  I was using a multi-value token with the % as the first and third values and the token value as the second value.  I was trying to combine all values in the token dialog window without choosing a divider.  Which it turns out defaults to line break.

Hardcoding the % before and after the token value in the search worked for me.

 

Thanks.

1 0
replied on November 2, 2020

Assuming ODBC data source, %%(tokenvalue)%  works for me. Can you show us screenshots of your activity?

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

Sign in to reply to this post.