Show_if expression depending on value in table

I am trying to hide a field depending on a value in another table.

I have 2 tables:
Inventory table - contains various item details, including a Quantity column which I only want to be visible if the QuantityRequired value is set to true for the particular type of Device in the LookupDevice table.
LookupDevice table - contains all types of Device, QuantityRequired and others

If QuantityRequired = TRUE when matched by Device in Inventory and LookupDevice tables then I want the quantity field to be visible on a form, otherwise hide it.

I have tried:
IF(LOOKUP([_THISROW].[Device], โ€œLookupDeviceโ€, โ€œDeviceโ€, โ€œQuantityRequiredโ€)=TRUE, TRUE, FALSE)

which seems to evaluate correctly when I test output of the expression, but it makes no different at all to the visibility of the field in the form.

The system displays: IF this condition is true:
โ€ฆ(One randomly chosen value from this list (
โ€ฆThe list of values of column โ€˜QuantityRequiredโ€™
โ€ฆfrom rows of table โ€˜LookupDeviceโ€™
โ€ฆwhere this condition is true: ((The value of column โ€˜Deviceโ€™) is equal to (The value of โ€˜Deviceโ€™ from the row referenced by โ€˜Keyโ€™)))) is equal to (โ€œTRUEโ€)
THEN use the value of:
โ€ฆโ€œTRUEโ€
ELSE use the value of:
โ€ฆโ€œFALSEโ€

Help!
Thanks,
DG3

Solved Solved
0 3 134
1 ACCEPTED SOLUTION

Hello and welcome to the community!

So basically, your Inventory should have a reference column to the LookupDevice table, with the latter key column named letโ€™s say deviceID.

For a particular row in your table, in order to retrieve a value from a referenced row in another table you should use the following expression:

[keyID].[valueToRetrieve]

So in your case you should use: [deviceID].[QuantityRequired], and the expression to use for the Show_IF formula should be: [deviceID].[QuantityRequired] = TRUE

I encourage you to read the short, informative guides below:

View solution in original post

3 REPLIES 3

Hello and welcome to the community!

So basically, your Inventory should have a reference column to the LookupDevice table, with the latter key column named letโ€™s say deviceID.

For a particular row in your table, in order to retrieve a value from a referenced row in another table you should use the following expression:

[keyID].[valueToRetrieve]

So in your case you should use: [deviceID].[QuantityRequired], and the expression to use for the Show_IF formula should be: [deviceID].[QuantityRequired] = TRUE

I encourage you to read the short, informative guides below:

Thanks - took a while to get my head around referencing things correctly but itโ€™s working the way I want it now.

Steve
Platinum 4
Platinum 4

If youโ€™ve not already found a solution, please post a screenshot showing the unwanted column displayed.

Top Labels in this Space