Hack to filter lots of data

Why are you all using regex for basic substring search though?

Use thisRow.[Full Text].Find(@Search.SearchFor.ToLowercase()) != -1 instead.

  1. This will look for exact string, while regex is in fact full of special symbols and patterns, and not necessarily an exact string
  2. This must be more performant than evaluating regex
2 Likes

So funny. I came here today to ask for help with a filtering problem and discovered the perfect solution…submitted almost two years ago by ME! Fortunately Coda has a better memory than I do!

2 Likes

@shishir my intuition is that this require a new row to be added for ea subsequent user. Hmm maybe I could build an automation that when a user is added to the user table it adds a row to the search table? I have several searches throughout my doc and ideally wouldn’t have to be adding and removing as people come and go

Yes, you do need a row per user. For my docs, I’ve added a button that creates a row for the user and it’s disabled if one already exists. It’s also helped steer people towards the search feature because they interact with the doc and see it pop up.

2 Likes

Hey everyone! Has anyone run into the problem with this solution where the end user keeps hitting “enter” on the search and then multiple rows are added? Or is it just my team loves to break things? LOL. Curious how best to curb thaaaat situation.

Hi Camille,

You’re not the only one experiencing this, it’s a common issue with this workaround. Here are a couple options that aren’t perfect, but might help.

The first option is to filter table to only show first row. If they add another row, they’ll see the yellow filter highlight and when they click on the first one, the others will filter out. This works, but leaves your table with lots of empty rows.

thisRow.In(thisTable.Filter(People=User()).Slice(1,1))

The button option can show “Search” on a button and really just be something to click on when the real action that lets the search happen is just clicking off the cell you’re typing in. But if it row is after the first row, it’ll show “Delete” in the label and delete the row instead. This is a better visual for what they are seeing and might help them easily fix the issue without worrying about it.

Add column called “Row” with the formula

thisTable.Find(thisRow)

Add a button column and for the label formula, use:

If(Row=1,"Search","Delete")

Then for the button action formula, use:

If(
  Row=1,
  _Noop(),
  DeleteRows(thisRow)
)

There might be other options, but these are the two I could think of.

1 Like

Thanks Ben! The first option works really well, especially in a published doc that is set to “play”. :smiley: I think we can get away with this one for now!

1 Like

Third option is to use Detail layout and set it up to take as little space as possible:

You’ll have the “1 of 1” paginator in the bottom though. But hitting Enter won’t add new rows, so that’s a plus.


P.S. If you don’t mind a missing underline when the search field is not focused, but are after the smallest view possible, here’s the ultimate option:

It results in this:

A nicer contender:

Results in this:

6 Likes

Cool take, Paul!

To the Coda team… it would be very helpful/interesting to have an in-line search bar as a Control.

(coughwheredoimakethesuggestioncough) :smiley:

2 Likes

Another solution @Camille_Nussbaum is to create a button in the row with the action DeleteRows(thisrow); disable the button if it IsNotBlank() and then have an automation that runs hourly or daily and presses all the button, thus cleansing the table. Good luck!

3 Likes

You create a new topic, then you look for were it says misc. You ckick on that and it gives you a dropdown. Select suggestion box.

2 Likes

@BenLee Is there any way to just turn off the “enter adds a new row” feature? Sure, there are times when it’s useful…but there’s also times when it creates problems. Thanks! Gregg

1 Like

I feel your pain here as well, but the best we have right now is to hide the new row option in the table settings, but it doesn’t block a new row from being created by pressing enter.

I think a short answer for us would be to add a setting for this, but that wouldn’t really offer much more to the product except for this scenario. We don’t have it on the map yet, but we will look at user specific options at some point and then we can have a more wholistic solution that removes the need for this setup and makes this a lot easier.

1 Like

@BenLee Thank you for your reply!