Include Primary Key and Table Name as Reference Constraints

Hello…

I believe what I’m trying to accomplish is a composite key between a STATUS table that also references TABLENAME of the child table. Ultimately my goal is to have different statuses that have the same “Name” but are used for different tables. In my STATUS table I have many different values that require a specific “Context”. The Context property is a reference to the TABLENAME of the table that wants to use the status.

Here is an visual example of what I’m talking about.

STATUS
ID Context Value
1e2356 OPERATORS ACTIVE
27yux4 OPERATORS INACTIVE
tjh249 OPERATORS TERMINATED
3yhjxc MACHINES ACTIVE
hgjcx7 MACHINES INACTIVE
OPERATORS
ID Status FirstName
826v24 1e2356 Joe
et2647 1e2356 Mary
96elx1 tjh249 Tom
MACHINES
ID Status Name
25whb 3yhjxc Dav01
kcs3n3 hgjcx7 Dav02

As you can see, I have “ACTIVE” listed as available choices for the OPERATORS table and the MACHINES table. When I create or edit an OPERATOR, I only want to see statuses that are applicable for that Context.

Is this possible?

Solved Solved
0 9 560
1 ACCEPTED SOLUTION

All rows from the STATUS table that have a Context column value of OPERATOR:

FILTER(
  "STATUS",
  ("OPERATOR" = [Context])
)

All rows from the STATUS table that have a Context column value equal to the current view name:

FILTER(
  "STATUS",
  (CONTEXT("View") = [Context])
)

All rows from the STATUS table that have a Context column value occurs at the start of the current view’s name:

FILTER(
  "STATUS",
  STARTSWITH(CONTEXT("View"), [Context]))
)

See also:

View solution in original post

9 REPLIES 9
Top Labels in this Space