I create Developer Metadata for each of the columns in the sheet. If a new column gets created, I track it and create another developer metadata for it.
The process above works great until the user starts to move columns using Cut (cmd+x) and Paste (cmd+v). When you cut and paste, the developer metadata is transferred to the destination column and as a result, you're ending with 2 metadata on the same column. It gets more complicated when you do that process multiple times.
Eventually, I collect the changes and I see more than 1 metadata on a given column and I don't know which of them to choose.
Do you have an Idea how can I deal with that scenario?
The flow explained:
- The user connect his google sheet document.
- I go over his sheet and create metadata on the columns.
Name [444] | id [689] | Country [997] |
---|---|---|
Du | 10 | US |
Re | 30 | US |
- The user is doing multiple changes on the sheet. One of the changes is cutting and pasting the column country over id. As a result, the column id gets removed but the metadata id we created stays on (Google Sheet API implementation)
Here is the new state:
Name [444] | Country [689, 997] |
---|---|
Du | US |
Re | US |
As you can see now, we have 2 metadata ids on the same column (Country). Why it is a problem for me? when I periodically collect the changes I recollect the metadata changes from the column. When I encounter two metadata ids on the same column I don't know which of them to choose. So why can't I just select randomly? because I already have an existing mapping on my end and I don't know which of them to choose now. Take into account that the user may have changed the column name also so I can count on the column label.