Creating a model with a custom mapping causes "field not found" error

Hi, I have a table that I've set up a custom mapping for in the admin section. The custom mapping works great when I'm viewing the data or interacting with it as a saved question. However, when I convert it to a model, it throws me a "unknown column" error. I'm able to resolve the issue by removing the custom mapping. Is this a known issue or is there another workaround? Note: i have a few loom videos on this but since it contains sensitive data I'm not posting here but I can send them via email if its helpful. Thanks!

Hi @tjmule
What I wouldn't do for a full stacktrace - normally - but you provided enough details to reproduce:
https://github.com/metabase/metabase/issues/23449 - upvote by clicking :+1: on the first post

Currently I would recommend using a database View, or do it in SQL with manual remapping.

1 Like

Ok, another question in the same vein. I disabled the custom mappings and redid it as a custom column with a case statement in the question builder. Works great. However, something I notice is that when I make changes to the model, then go to edit the query definition, all of my changes to the model are undone. What can I provide to you that would help identify what's going on here? Again, it's sensitive data so I'm trying to figure out the best way to share it with you. Thank you in advance!

@tjmule Have a look here and make a decision if you want to use Models or just a View on your database:
https://github.com/metabase/metabase/issues?q=is%3Aissue+is%3Aopen+label%3AQuerying%2FModels

That's this issue: https://github.com/metabase/metabase/issues/22517

Is this a subtle way of telling me to steer clear of models for the time being? I'm trying super hard to commit to them but I'm having a helluva time with all my work getting undone.

@tjmule Let me phrase it this way. I don't use Models for anything currently - besides on my test instances for creating bugs. There's going to be a pod in the future, which goes through all the issues, then they might be worth revisiting at that point.

Understood. You're the best Flamber. Appreciate you.