What is your goal?
Check if data exists
What is the problem & what have you tried?
Can not find the “exists” basic operator
Check if data exists
Can not find the “exists” basic operator
Hey Brandon,
in a filter or when mapping something? The function is called ifempty(), checks if the mapped value exists and allows you to specify a replacement value if it doesn’t.
Hello Brandon,
Welcome to the Community!
Please let us know what you want to achieve by filtering. There can be different approaches to efficiently solve your problem.
There is no native “Exists” operator. If you want to process data differently based on the existence of a value, you should use the Router module and configure routes properly.
If there is no need to differentiate- for example, if you are using non-trigger modules as your starting module in a scenario - simply configure the filter.
Learn more about filters: Filtering - Help Center
Welcome to the Make community!
A variable existing and having a value have different meanings depending on the context. A variable can exist and have a value, or exist but not have a value. I am guessing you likely want to check if a variable contains a valid value (something that isn’t null, undefined, empty, or of zero-length for strings/arrays).
Here are some common ways to check if a variable contains a value (NOT null, undefined, empty, or of zero-length for strings/arrays). This list is non-exhaustive, as there are many more ways to do it.
ifempty() function:ifempty(value1; value2)This falls back to the second parameter if the first parameter is null, empty (zero-length), or undefined.
![]()
| Note: | ||
|---|---|---|
| The second parameter is optional, you can leave it blank if you don’t want to do anything if the first is null, empty (zero-length), or undefined. i.e.: |
if() and length() functions:Here’s an example of how you can use these functions together:
{{ if(length(text) > 0; value1; value2) }}
![]()
| Note: | ||
|---|---|---|
| The second parameter is optional, you can leave it blank if you don’t want to do anything if the first is null, empty (zero-length), or undefined. i.e.: |
You can use a filter before the module to pass / continue only if the variable contains a value that you are expecting.
This checks if the length of the string or array contains at least one character or item.
This checks if the string exists and is not an empty (of zero-length) string "".
In most cases, this may seem to work just fine, especially for strings of zero-length, and it does not “pass” (let the bundle through) when the variable contains no value / an empty string.
This is because the “Exists” filter operator is a simple boolean (true or false) check. What happens behind the scenes is something called “Type Coercion” — when one value needs to be converted into another type. The variable needs to be converted into a boolean (true or false) before the computer language/code knows whether it “Exists” (true), or “Does not exist” (false).
Hence, it may not work as you expect it to work the way you need it to, as the converted variable may not return the boolean value you expect. For more information, see Type coercion in the Make Help Centre.
You can possibly learn more about this in these Make Academy units:
An introduction to data types and data structures
Hope this helps! If you are still having trouble, please provide more details.
— @samliew
P.S.: investing some effort into the tutorials in the Make Academy will save you lots of time and frustration using Make!