withName multiple variable support

I often find myself needing to define multiple name variables before banging out the formula. Currently this means nesting withName(statement1, name1, withName(statement2, name2, ...).

With auto format, this leads to a lot of indentation and encapsulation, which is distracting. It would be great if withName allowed a set to be defined, similar to ModifyRows. I don’t know what syntax would work best with Coda’s formula language, but idea is something like:
withNames(statement1, name1, statement2, name2).Do(...)

4 Likes

If I can add to this, it’d be much neater if it was

WithNames(
  name1, statement1,
  name2, statement2,
  expression)

rather than either:

WithNames(
  statement1, name1,
  statement2, name2,
  expression)

or the current:

WithNames(
  statement1, name1,
WithNames(
  statement2, name2,
  expression))

The first one avoids overuse of parens and the need to balance them. It is also visually cleaner, and works better with the auto-indenter. Lastly, it’s better than the second one because the names are listed first. This is much easier to work with. In pretty much all programming languages you write x = blah blah blah, not blah blah blah → X. The reason for this is that 1) variable names are shorter and easier to alight vertically, and 2) it makes it easier to find what the definition of a variable is. Putting the statement first and then the name second was poor design.

2 Likes

lets function

I noticed that Coda has introduced the Let() function, which essentially duplicates the functionality of the WithName() function. This makes me wonder if it’s a precursor to the introduction of a Lets() function that would support multiple variables simultaneously.

Using WithName() with just one variable is quite inconvenient, especially for complex formulas. Wrapping variables in nested parentheses, like swaddling a baby, isn’t exactly a disaster, but having a more optimal solution would be much nicer. I hope Coda is moving in this direction.

2 Likes

Just throwing my vote into the hat. I keep coming across situations that end up looking like this example:

Coda is amazing and I would love to see a Lets() function similar to excel.
As @Matthew_Strax-Haber stated above

Lets(
  name1, value1,
  name2, value1,
  expression
)

TLDR:

  1. Please add a function that allows multiple name/statement pairs like in excel.
  2. Please put name first so that the code is easier to read.
1 Like

Yesssssssssss… Add Lets() or WithNames() and put the name first.

@Logan_Krantz @Tamerlan_PRO @Ed_Liveikis Coda recently announced that they aren’t monitoring this forum anymore. They suggested that you email support@coda.io. Maybe if they get a bunch of feedback requesting this they will implement it?

1 Like

:waving_hand: @Matthew_Strax-Haber

sorry i must have missed it but where did they announce they arent monitoring this forum anymore?

was it this? Coda community support update

A quick community moderation update: If you encounter Coda product bugs or have issues with docs that contain private data, please reach out to the Coda Support team directly, as they do not monitor or respond in the Community forum. If you have a current issue that has not been addressed, please email support@coda.io or open a chat by selecting the question mark in the bottom-right corner of your Coda doc.

i think it was more so the dev team/engineers monitoring or responding to in relation to “product bugs or have issues with docs that contain private data”?
also, dont think if something like feature requests falls under the banner of emailing support?

but yeah, team withNames or Lets - i just voted! haha

cheers!
Mel

:index_pointing_up: added note from future me: there’s probs too much caffeine in my bubble tea today or having recently taken up gratitude journalling again but you know - im just thankful to even have WithName… because (last i checked) products like notion, airtable and fibery dont even have that :sweat_smile:
so having a messy CFL panel is ok by me :upside_down_face:

1 Like

Email sent! Fingers crossed