Button to force a specific select list?

I have developed a multi-table todo list app that mixes in multiple projects, contacts, links between contacts, events, etc… in order to stay on top of it all, I have a few select boxes to filter down my task table to those most relevant at the moment. as I use this app, it has become apparent that there are a few filter sets which I will use with some regularity (although the filters may change from time to time). rather than have a ton of view sections, I would like to be to create a button to force these views. something to the effect of forcing the select list in a few control boxes to specific values. is this possible? essentially it would require using a button to control the value of select box variables. is this possible in the coda’s current form? thanks.

You cannot change canvas control values (selects, checkboxes etc) with an action.

Instead, make a table or a few tables that would serve as controls. You can modify values in the tables with ModifyRows(), and you can use them in formulas with some extra work.

Here’s some inspiration:

This is a table:

I have an SwitchIf() formula that populates a different list of values for different rows. Then I refer to these rows in filters by row reference @Select company.Value

And this is a table, in Detail view to simulate a form:

When I use the stopwatch to track time, the “Log to current task” button adds tracked time to what’s selected in that form.

And here’s the table that shows all tasks for selected client, and each task has a button to modify the “Current task” value to set thisRow as a current task:

1 Like

Just wanted to reply to say THANKS for putting the time into showing this example. It really is showing me some interesting and powerful tools that will help in my own little Coda setup in my business! Cheers!

Many thanks!

Though, I think this solves one issue and creates another. I am trying to create a filter, which could have multiple values selected. For example, lets say I have a lookup table for status with values urgent, this week, this month, done, dead, deprioritized.

I can use your method to set a row or two for a filter table to urgent and this week, but what if want to reset my filter back to the entirety of the original lookup table? is there a way to do something like filterTable.filter=status.values so that I don’t have to hard-code my lookup table in a button?

Yeah, you can:

a) make a reset button that will simply overwrite the filter cell with the whole selection of values;
b) make a reset button that will make the cell blank, and in your filter formula you add a conditional that if the filter cell is blank, apply no filter, e.g. filter formula filterTable.filter.IsBlank() OR status.In(filterTable.filter) that will return true for all rows (and filter out nothing) if no values are selected

thanks. understood on b). what is the formula that works for a)? Ideally I would like to use whatever is in the lookup table as the source and not have to hard code many different “add row” lines, which is the only way I have found so far to get multiple entries in a filter table.

Why would you need multiple entries in a filter table? You use a single cell with multiple values in that cell. A multi-select lookup column if you will.

Anyway, if you want to add all rows from e.g. Status table, you can use FormulaMap:

  filterTable.AddRow(statusLookupColumn, CurrentValue)

will add as many rows to the filterTable as there are rows in the Status table, and insert each Status row into a statusLookupColumn cell of respective added row

awesome, thanks. I’ll play with this. my issue with putting them in one cell is a referencing issue. I get a flat text list instead of row references, which makes the filter fail. is there a way around this? I’ve found coda’s handling of references vs values very non-intuitive…

the formula map approach seems to have the same referencing issue for me- it copies the text from the first table, no problem, but it doesn’t bring over the reference, so the lookup filter doesn’t work. is there an easy fix? thanks

I don’t really understand what you’re doing there. Can you perhaps share the doc here or with me actinarium@gmail.com and I’ll look into that tomorrow afternoon?

One thing: if you’re getting text values, this must mean you’re iterating over text values, e.g. SomeTable.SomeColumn.FormulaMap(). You need to iterate just over the table, e.g. SomeTable.FormulaMap().

thanks! just shared a somewhat similar doc which shows what I’m trying to get done. I’d love your thoughts!

Hey, since you needed filter presets, did something different than originally thought. I shared the doc with you, but do you mind if I also share it publicly, since it contains some learning value and no sensitive info?

thanks! this is a neat solution to filter presets and definitely hits the functionality that I was going for. I’ll have to dig in to see what I was missing on syntax, etc.

Sure, feel free to share. I would have definitely benefitted from more sophisticated examples when trying to figure this out.

@Paul_Danyliuk thanks again. I got this up and running on my project and it works great. also, FYI, I was able to simplify the filter logic by putting a checkbox column in my table for each column to be filtered by a preset. e.g. fstatus checkbox would be true if either the status filter was blank or the row matched the status filter. I’m not sure what this does to performance, but it makes the filter logic a lot more readable…

Hi - this is Anna :slight_smile:

I’m having the same issue, i.e. would like a button to add a row with some preset value for a select column, however it only brings over the selection as a copied text instead of a selectable item.

The situation I have is that the respective table has permanent filters applied to it to separate it from its master parent view. The newly added row (via the button) then filters out because the filtered column does not contain the selected item as a lookup but only as a faint text copy which then disappears as the column is not actually formatted to be a text column. I believe @Paul_Danyliuk had found a solution to this using the function FormulaMap() ? How would that solve the issue / what would the formula look like?

Also, if you don’t mind @Paul_Danyliuk, I couldn’t find the document that you shared publicly made by Ben that included the solution, would be amazing if I could have a look :slight_smile:

Thanks already lots in advance!