How to write a formula to get text length in a Math column?

Hello. I am a user from Japan developing an app with Glide. I have a problem I can’t solve while implementing an “AND search” feature and was hoping for your help.

My Goal: I am trying to create an “AND search” feature where a user selects multiple ingredients (e.g., “Pork”, “Onion”), and only recipes containing all of those selected ingredients are displayed.

The Problem: To achieve this, I first need to check if a helper column is empty or not. I tried to do this by counting the number of characters in that column using a Math column.

My helper column is a Template column named ユーザー選択1_テキスト.

When I enter the formula LEN(ユーザー選択1_テキスト) in the Math column, I get the following error: Around "ー選択1_テキス": There should be a "," or a ")"

(Please see the attached screenshot for the error.)

My Question: In the Math column, what is the correct current syntax/formula in Glide to count the number of characters in another column (in this case, ユーザー選択1_テキスト)?

Thank you for your help.

Let me first say that you appear to be approaching this in a very roundabout way. The normal way to do this would be to first create an array from the selection using a Split Text column, and then use that as a filter - either by creating a relation, or by using contains in an if-then-else column.

However, I’ll ignore that for now and directly answer your question…

Don’t use a Math column. Instead, use a Text Length column.

Also…

You can directly check if a column is empty or not with an if-then-else column. You don’t need to check the number of characters.

Thank you so much for your quick and accurate response! Your advice, especially that I can directly check if the Single Value column is empty in the If-Then-Else column, was the key. I had created many unnecessary helper columns.

By simplifying the logic as you suggested, I was able to solve the problem perfectly. Thank you again!

2 Likes