Push Buttons in Certain Order

I want to push buttons in a column of a table in a specific order, first where a specific row contains A then B then C is that possible?

Not actually alphabetically because I realize I can sort the table how I need it and then the push buttons will go top to bottom. If this is the only way to go about it then is there a way to sort columns based on matches or would I just maybe add a formula column with a numbering scheme and then sort on that. (i.e. Column = Dog, 1, Column = Cat, 2, 3)

Thanks!

:wave: Hey there!

Test this out and hopefully it gives you some ideas. All formulas and explanations are inside the doc. There are definitely other ways to do it, but you can essentially wrap your actions inside a button using RunActions() which will specify the specific order in which they are pressed

1 Like

Scott,

Thanks for the quick reply. This was close but I forgot to mention a fairly big hurdle. My table completely reset and changes on a daily basis. My order is not necessarily A, B, C but more like press all A’s then all B’s then all C’s, without know in advance how many of each their are.

I think a couple of hidden columns that help with sorting is probably the best bet I just don’t like how often I use that as a crutch, my tables are riddled with extra columns.

In that case, you could probably do something like the following

RunActions(buttonTable.filter(letterColumn="A").button,
buttonTable.filter(letterColumn="B").button)

Essentially saying - “Hey Coda, go find every button in my table where the letterColumn is A and press it. After that is done, go find every button in my table where the letterColumn is B and press that.”

That’s gonna work! On mobile at the moment but will try it in a bit and circle back. Thanks Scott! Now I just need to solve this lookup of a multi select from a multi select problem….

Just thought of a better way (if you are working with a data set that could be sorted such as numbers, strings of text alphabetically, or dates):

[Buttons in Order].Letters.Sort().FormulaMap([Buttons in Order].Filter(Letters=CurrentValue).Button)

I reset my embedded document with a new green button that utilizes this method. Should give you some thoughts to work with. I can a think of a few other ways to get it done but difficult providing direction with a shared doc or exact use case.

Hopefully it helps though!

Just got done making my changes and your previous suggestion worked a charm. I may add this nested within the last one. I basically have text based categories with priorities “High” “Medium” “Low”. The first solution addresses that and then what you’ve just provided should allow me to sort within to prioritize dates.

1 Like

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.