I am attempting to copy a new row from one Google Sheet to another when a new row is added on the source sheet. I have this scenario working, but I noticed that if I make any changes to the source sheets columns i.e. moving them around or deleting and adding new ones. The mapping gets misaligned due to the mapping not matching any longer. I would have assumed that the mapping would use raw column ID’s that stay stuck in the mapping even if you move things around. Cay anyone comment I this is expected behavior and whether there are plans to fix this?
When you configure a GSheets module, it grabs the latest headers at the time you refreshed the module. You’re assigning variables and data to column positions, the names are just there to try to be helpful.
Hopefully someone that knows better will chime in, but I would say there’s nothing we can do about this because there’s nothing keeping you from using duplicate headers.
As far as I know, GSheet cells, columns and rows don’t have any underlying IDs that can be used in lieu of their positions.
I can think of one way to deal with this…
You would have to guarantee yourself you won’t use duplicate header names.
Then, when a source row comes in, iterate each column’s header/name, search row 1 of the destination sheet for the column with that same value, then write the value to the destination row in the matching column.
I know it’s not quite the answer you were looking for, but I hope it was a little helpful and makes sense.