Hi, I need help refining a Saved Search filter beh...
# ask-stanley-ai
m
Hi, I need help refining a Saved Search filter behavior. Here’s what I’m trying to achieve: • I want to create a user-facing filter on the Amount field (or a text version of it). • If the user leaves the filter blank, the Saved Search should return all results. • If the user enters a value (e.g. “100”), the filter should match only that exact value, not “1000” or “100000”. Here’s what I’ve tried: • I created a Formula (Text) field using TO_CHAR({amount}) and added it as an Available Filter. • To make the filter show up, I had to add a hard criteria like Formula (Text) IS NOT EMPTY. • If I use the “IS” operator in the filter, I get no results when the filter is empty. • If I use “CONTAINS”, it returns too many results (e.g. entering “100” also brings back “1000”, “100000”, etc.). • I thought of adding a second filter to simulate “contains at least a digit”, but NetSuite doesn’t support regex or conditional logic in filters natively. What I need is a way to let the user filter by a specific amount as text, but also allow empty input to return all results without overly broad matches like “contains”. Any workaround or smart approach with formulas or UI tricks would be appreciated!
c
AI generated answer (using internal Slack threads):
Based on the conversations, it seems like you're on the right track with using a Formula (Text) field and making it an Available Filter. However, the issue you're facing is with the operator you're using. Here's a workaround you can try: 1. Create a Formula (Text) field using
TO_CHAR({amount})
and add it as an Available Filter. 2. Set the default operator for this filter to "is". This will allow the user to enter a specific amount and get the exact match. 3. To handle the case where the filter is left blank, you can add a condition in the Criteria section of the Saved Search. Use the "OR" operator and add two conditions: - First condition: Formula (Text)
IS EMPTY
- Second condition: Formula (Text)
IS {filter}
This way, if the filter is left blank, the Saved Search will return all results because the first condition (Formula (Text)
IS EMPTY
) will be true. If the user enters a value in the filter, the Saved Search will return only the records where the amount matches the entered value, because the second condition (Formula (Text)
IS {filter}
) will be true. Please note that
{filter}
should be replaced with the actual internal ID of your user-facing filter. ****** Disclaimer: This response was generated by an artificial intelligence assistant based on previous conversations from multiple Slack channels, and may contain inaccuracies or mistakes. ******
Slack thread 1: here (available only if the original thread was posted in the last 90 days)
Similarity score: 0.837038
Slack thread 2: here (available only if the original thread was posted in the last 90 days)
Similarity score: 0.828281403
Slack thread 3: here (available only if the original thread was posted in the last 90 days)
Similarity score: 0.827468336
Please provide your feedback on this answer.