Using AND in a filter after adding a number of OR conditions.
What is the problem?
If I’m adding an AND condition after a series of OR conditions does the AND condition only affect the last OR condition I created or all OR conditions?
I want to pass ‘Armstrong’, ‘Aldrin’, and ‘Collins’, but I don’t want to include ‘timeline’, ‘launch’, or ‘landing’.
Should it be
Armstrong
OR
Aldrin
OR
Collins
AND
Timeline
AND
launch
AND
landing
In general, you will want to entirely AVOID using OR conditions, or AVOID mixing OR with AND conditions, because “OR” conditions create a new group of filter conditions. When that happens, you will then have to repeat similar filters across all the groups.
May I suggest using “Text Operators: Matches Pattern”, or “Array Operators: Array Contains” instead? This way, we can eliminate the use of “OR”.
To achieve your goal, you’ll need to group them like so:
Equals Collins and not equal timeline and not equal launch and not equal landing
OR
Equals Armstrong and not equal timeline and not equal launch and not equal landing
OR
Equals Aldrin and not equal timeline and not equal launch and not equal landing
You can also use more advanced methods like samliew suggested.
Thanks for the response.
I want to use Matched pattern, but I don’t understand the syntax (pipe symbols, dollar signs, etc) and can find no help as to why it is written like this. Can you assist or point me to a resource?
Sorry if this seems basic, but brand new to all of this.
When you see the word “Pattern” in Make, it most likely refers to a Regular Expression (pattern).
Regular expressions is something you’ll have to learn and practice to get better at, and you aren’t expected to know how to use it within Make. However, it is a very powerful and useful tool as you can possibly easily reduce lots of operations into a single operation within your scenarios. For example, instead of “looping” through arrays with Iterators and Filters, we can convert it into a single text variable before extracting data in a single operation.
To answer your last question, a good resource you will definitely need to use to build and have individual parts of the regular expression broken down and explained, is to use the online tool Regex101.com.
Quick Guide on How to Use Regex101.com
Top: Paste in the regular expression pattern
Below: Paste a complete/full example text you are trying to match from
Select: “ECMAScript” from the left sidebar
Right: Explanation of what the pattern does
Bottom Right: Preview of matches from the example text
Using regex101 will allow you to verify that the pattern is working correctly, before you use it in Make.
Learning & Using Advanced Regular Expressions
Within Make’s documentation, it isn’t mentioned much, and I could only find a reference here Text parser - Help Center, which says:
The search pattern is a regular expression (aka regex or regexp), which is a sequence of characters in which each character is either a metacharacter, having a special meaning, or a regular character that has a literal meaning.
For experimenting with regular expressions, we recommend the regular expressions 101 website. Just make sure to tick the ECMAScript (JavaScript) “FLAVOR” in the left panel.
You can also learn more about regular expression patterns by searching the internet, which has hundreds and thousands of tutorials, courses, & videos.
Get Expert Advice
If you require an expert to help you look at your scenario to see if regular expressions can be used to reduce the complexity and number of operations in your scenario, please use the Hire a Pro > Hire Help category. For example, instead of “looping” through arrays with Iterators and Filters, we can convert it into a single text variable before extracting data in a single operation.
It is important to post your request in the Hire a Pro > Hire Help category, as other forum members are not allowed to advertise services in other categories like here. Posting in the Hire a Pro > Hire Help category will also expedite your request as other members can assist you over other forms of communication like direct messages, emails, and screenshare.
How to send direct messages?
This forum has a semi-hidden messaging feature which you can use to directly reach out to other forum members.
Warning:
New forum accounts do not have permissions to send private messages. Simply earn trust levels first by being active on this forum
1. Message Inbox Page
You can message another user from your message inbox page, and click on the “New Message” button on the right.
2. User Card / Profile Pages
You can message another user from their profile card on each post, or visit their profile.
3. Creating a New Topic
The last method is by using the “New Topic” button to begin composing a new topic. Click on the symbol to switch the post type to a “New message”.
Do you have a question that is not about "Using AND in filters"? Please start a new topic.
Creating a separate topic for each question makes it easier for others with the same problem to search for answers. You are also more likely to receive help sooner as new topics are displayed first on the forum’s “new” page!