Issue with RegexReplace Formula Result

Hello Coda Community,

I’ve been working with a formula to reformat date strings in the NOM_DOSSIER_PROPALE column of my References_commerciales table. The formula I used is:

References_commerciales.NOM_DOSSIER_PROPALE.RegexReplace("(\d{4})_(\d{2})_(\d{2}).*", "$3/$2/$1")

The goal was to convert dates from YYYY_MM_DD format to DD/MM/YYYY format. While the formula itself seems correct, I’ve encountered an issue: the date result is always the same, regardless of the actual value in the NOM_DOSSIER_PROPALE column.

For instance:

  • 2023_07_21_filename and 2024_08_22_filename both result in the same date being displayed after applying the formula.

This indicates that there’s a problem in how the formula processes different values. I would appreciate any insights or suggestions on how to resolve this issue to ensure that the correct date is displayed for each entry in the column.

Thank you for your assistance!

i think you need to replace References_commerciales.

with

thisRow.

By referencing using table-name.column-name, you are passing the entire column to the regex formula, and it selects/replaces the first matching pattern , which is the row 1 date.

thisRow.column-name on the otherhand passes just the one cell to the regex formula.

max

1 Like

Gosh yes! Obviously! :upside_down_face: Thanks @Max_OBrien

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