A column that is a lookup to different tables based on a table id?

Hi Everyone

I wondered if anyone has any suggestions to solve a problem I’m having in my doc.

I have different tables of entities i.e. DB Standard Experience or DB Clients.

I also have a table of tasks that can be assigned to the different entities.

I’m attempting to make a lookup column to the different entity tables based on a tag (called a Lifecycle Type).

I have managed to get it to work based on a page I found on the community pages (see attached photo) - but i have to hardcode what i want to check the lifecycle type against.

I want to make the formula as reusable as possible, and was thinking of adding the entity table ids against the lifecycle types, in the hope it can reference these for the lookup tables. I was wondering if anyone has experience of this or if its even possible? Any suggests or feedback would be very welcome :grinning:

Hi Emma, as far as I know (and someone can correct me) there is no way currently in Coda to dynamically create table references (by id or name or whatever) — except through switch statements like you have already done. So you have to hardcode it into the formula. But, if it makes it nicer, you could put that switch statement into a separate named formula, or even into a table from which you could do a lookup on.

However, if you were to share your doc, or a dummy copy sample, we would love to see what else we can do to help. I have a feeling a schema change might be what you are looking for.

2 Likes

Hi Ryan

Thanks for the help.

I may have a go at your suggestion and once I’ve trimmed all the sensitive data out of the doc I will share it :slight_smile:

Emma

2 Likes