Hello!
I am unsure how to write a Custom Filter expression for the following scenario - I will be connecting a 'Text' Interface tool so the end user can type in the specific answer they are looking for.
There will be a field with policy numbers, and the default for the filter should be "all", unless they enter a specific number in the prompt within the Text interface.
So the custom filter would be something like:
if [Policy Number] = '1234567' then '1234567' else [Policy Number] endif
Then I could use the Text box interface tool and if left blank, all policies would come through, and if a policy number is entered, only that policy number would come through.
I've attached a mini workflow for the scenario...any input is greatly appreciated!
Kim
Solved! Go to Solution.
@kas I have detailed the steps below.
1. You need to use a formula within the action tool you have connected to the filter.
2. I changed the tool that gets updated from the filter itself to a formula tool to create a variable.
3. In the filter tool, if the previously created variable doesn't change, it won't filter anything out - if it includes a value passed in, it will filter to the desired policy number.
Bacon
You can update the filter condition with anything and add a action tool with below config
if isnull([#1]) then ‘true’ else “[Policy Number] =‘“+ [#1] +”’” endif
what this will do is, if you don’t have an input, it will just pass ‘true’ and everything will pass, else it will replace the filter condition with the else part.
I am writing out of memory, so make any syntax correction if required.