Question regarding the "ifEmpty" function

So let’s say I’ve got a page where at the top I want it to say “Searching Everyone”. If, however, the user enters a name into the search bar (let’s say “Doug”) I want the title to change to “Searching People Named Doug”)

I know there are roundabout ways to accomplish this by building out additional variables, but I’d really like to avoid that and just accomplish it purely through a formula. Is this possible?

The ifEmpty function is the closest, but the issue is I can’t prepend text to the value. Here is a working forumula, but if the user typed in “Doug” the output would end up being “Searching Doug”:

image

Is there a way to essentially say “If [VARIABLE A] is not empty, show [CUSTOM STRING A] . Otherwise, show [CUSTOM STRING B]”?

Found my own answer! Looks like this can be done through a simple “If” function as shown here:

image

My initial concern was that because my search input variable wasn’t returning a literal true/false this method wouldn’t work but it indeed does!

1 Like

falsy values can be useful

1 Like