Launched: Text input control

Controls in Coda give you a core set of elements to interact with and edit your data. You may have used or interacted with checkboxes, date pickers, sliders, select lists, or other controls in your docs to filter tables.

Following a successful beta (thank you testers!), we’re excited to announce that text input controls are available for all Coda docs.

We’ve seen some pretty creative ways to build table search in Coda, but now it’s as simple as adding an interactive filter to any text column. Once added, you can name the control, edit the placeholder text, and choose a unique icon as well.

If your primary goal is to use the text input control to search a table, you can do so from any text column:

  1. Click the column header
  2. Select “Filter” > “Interactive Filter” > “+ Create control”
  3. Your text input control will automatically be placed above your table; right click it to edit any details or settings

(Note: you may have to reload the browser tab for the new control to become available)

If you prefer to write a custom formula to filter a table for your text input control, follow these steps:

  1. Hover over your table to expose "Options” in the upper right corner
  2. Select “Filter” from the table options menu
  3. From the filter configuration panel, click "+ Add Filter”
  4. Select “Formula”
  5. Use the Matches() formula to set-up search for your table

For example, for the tables in the post, the formula is =thisRow.Name.matches(MandoSearch) where Name is the name of the column I’m searching, and MandoSearch is the name of my text input control. If you’d like to search multiple columns from the same control, remember that you can use OR in your formulas to build out your logic.

As with any other table filter, filtering based on inputs into a text control will display the filtered view of your data to anyone else viewing the table at the same time.

Tip: Your controls and tables do not have to be on the same page. In fact, you can type /text to add a control on any page. Just be sure to name your controls something memorable so that you can easily reference them in formulas.

We hope this makes it even easier for your scale and organize your data while you put it to work in Coda!

72 Likes

Now this is lovely improvement!
Haven’t tested it yet, I hope it can search number fields, lookups etc. and not only text fields
Also is it possible to use one control to search more than one column at same time?

2 Likes

If I get it right, it’s possible, just use “OR” function, like “thisRow.Name.Matches(MandoSearch) OR thisRow.Descripion.Matches(MandoSearch)”

If you want to search for lookup value, maybe you can refer the display text of the lookup value, for example “thisRow.Student.ToText().Matches(StudentSearch)”, for Student where Student is the name of the lookup column.

1 Like

FYI, I had to log out and then back in to Coda to see this update.

2 Likes

I believe so yes! I have an example here:

I originally created this text input as an interactive filter on Column 1. Then I adjusted the filter formula to include “OR Column 2.Matches(Search Table 1 Column 1)” and it’s working as expected.

4 Likes

Hi Marko! To search more than one column, you’ll want to use a formulaic filter with the Matches() function, and use OR in your formula to indicate multiple columns. Different column types have different types of controls by default, but using the OR function will let you search number columns and the text of lookup columns.

In the example above if I wanted to search both Name and Description columns with the text input control, I’d write the formula as =thisRow.Name.matches(MandoSearch) OR thisrow.Description.matches(MandoSearch)

3 Likes

Can you use more than one control on the same table? Like, have one control for one column, another control for another column, etc?

Indeed you can! Multiple controls for the same table will function as “and” clauses for filters by default.

For example, if you have a lookup control on a table of local restaurants that references text items and a scale control that represents a numeric scale column (e.g., 1-5 star rating), if you set:

  • Your lookup control to “Pizza”
  • Your scale control to 4-stars

Your table would filter down to lines that match both clauses (likely 4-star pizza restaurants in this hypothetical, because I need to finally eat dinner).

However, you can always open the table’s filter settings (hover over the table and select “filter” from the menu that appears) to get more specific. You could change the logic to be “Or” by clicking on the space between your filter conditions. You could also change the default for how the scale control is applied (from something like “matches exactly” to “is greater than”).

Generally speaking, if you’re adding controls to tables, it’s worth taking a look at your filter settings and/or right-clicking on a control to see all the settings you might have at your disposal!

2 Likes

This is great! I’ve been waiting for this. Thanks Coda!

But, now the biggest thing still missing is the ability to Set control value using button action, i.e. a ModifyControl() function to complement ModifyRows(). :wink:

1 Like

Great work! Is there any way to filter the input formula per user, such as shown in the DIY version?

5 Likes

This is now a lovely update.
I would second @Baeyens_Michael question. It’s crucial for a good UX.

1 Like

Nice one!

Is it possible to use this feature with a Lookup field? Because every time I do the create control on a lookup field, it shows no input but the multiple choice one.

If I’m understanding what you’re asking, you’re going to want to manually create the input field and filter formula and then it should work as expected.If it doesn’t, use “toText()” on the lookup column.

2 Likes

Putting this here for posterity.

If you’re trying to an OR string match (e.g.“I want to match against ‘dog’ or ‘cat’’”) you can use FormulaMap for that.

Your search input would be dog cat and your filter would be:

Search_Input
    .Lower()
	.Split(" ")
	.FormulaMap(
		thisRow.[SearchColumn].ToText().Lower().RegexMatch(format(".*{1}.*", CurrentValue))
	)
	.Filter(currentValue)
	.IsNotBlank()

With comments:

// Spit the input text by the char of your choice (spaces, in this case)
Search_Input
    .Lower()
	.Split(" ")

    // Compare each word in your search string against the text in your search column
    // .toText is used in case you're using a non-text column (like a lookup)
    // .Lower is used because we're unable to pass the case-insensitive flag
    // Wildcard is in regex match to support partial match and empty strings (I prob only need one)
	.FormulaMap(
		thisRow.[SearchColumn].ToText().Lower().RegexMatch(format(".*{1}.*", CurrentValue))
	)
    // You'll have an array of true/false values, then will filter for all the trues
	.Filter(currentValue)

    // And if there are any left, you've got a match!
	.IsNotBlank()
8 Likes

@MrChrisRodriguez thanks for the context, this really helps to ‘get the feeling’!

Thanks for noting this! I thought I was going crazy when it didn’t work as documented. @Gleb_Posobin I suggest noting the need to log out/in at the top of your post in boldface.

2 Likes

That’s strange, it should work simply after refreshing the page. Can you please confirm that you have tried refreshing the browser page and the text input did not become available after that, only after log out and log in?

Well, I created a new page within my Coda doc before trying to use it, though I am not sure if that reloaded the browser page. I run Coda as a pseudo-app, using Unite, so I don’t necessarily launch a new window before using.

a.

1 Like

Yeah, making a new page doesn’t refresh the browser tab (or the unite window in this case). I added a note to the announcement, thank you for reporting!

This is a game changer - thanks Codans

1 Like