Creating Default values with a Lookup

Hi there - I have looked through older posts but nothing quite answers my question. The closest answer I could find (from 2019) starts with “Create a column that contains the default picture in every row” which is the part I’m struggling with. See details below:

I’m trying to set a default image in a couple of tables and have a Lookups table - basically one row with a single value for the column “ImageDefault”. I use a Lookup in another table to set the default image for each row in that table. I then have an if-then-else column which I want to use to pick up the user-defined image from another column if it exists, otherwise use the ImageDefault Lookup.

Problem is, I can’t see the ImageDefault in the if-then-else pick list so can’t build the rule. I can see the other image columns there, both of which are also lookups from other tables, but not this new ImageDefault Lookup.

Is this because I have not used the relation/lookup combination to drill into a single record? I only have one record (cell) in the Lookups table column, so haven’t done a Relationship in the other table, just a Lookup. The image the Lookup brings back appears to me like a single record (literal) and not a structure (ie. doesn’t show as a shadowed collection in the column but as a single image). But maybe your system needs a relationship/lookup? If so, can you suggest another approach because there’s no way to key into the Lookups table to set up that relationship/lookup on the other table.

One way to ‘key‘ into the other table would be to put a template column in both tables that contains the same word/ letter. It could be as simple as the letter ‘x’

Then build a SINGLE relation between those two template columns. Next use a lookup column via that newly created relation.

Finally use this new lookup column in your If-Then-Else statement

If it’s only one row you could use a single value column (instead of a lookup) from the destination table and target your ‘ImageDefault’ columm

I was hoping not to have to add a key to each thing, but makes perfect sense. Thank you!

I found it!

Use “* single value” instead of Lookup : “computed values / other / * single value” (does the work of a Lookup but brings back the value (literal) instead of the record).

This way you can find the default without setting up an additional key for the relationship.

1 Like

Yes, using a Single Value is the best approach for your use case.

The reason your lookup wasn’t working as you expected is because when you target a lookup column directly at a table column it will always return an array, even if the target table only contains a single row.

1 Like