using "Label" instead of "Key" in slice

Hi everyone!

I have two tables:  a) project and b) tasks

Asheetbogo_3-1665601834385.png

in table "Task" i can select multiple Projects with "EnumList" - works fine - even inserting new projects from EnumList to "project-table" woks perfect!

Asheetbogo_0-1665601611404.png

But if i want to setup a "Project-Filter" (e.g. "Project A") in a slice i have to filter with "key-value" of Project-field (e.g. "abee2625"), as in table "tasks" there are only key-values for all projects i have selected.

Asheetbogo_2-1665601701956.png

Asheetbogo_4-1665602572265.png

Asheetbogo_2-1665601701956.png

How can i achieve that "project-label-values"  (e.g. "Project 1") are saved in "task-table" instead of "project-key-value" (e.g. "abee2625") for being able to filter with  "project-label-value" (e.g. "Project 1") in my slice?

many thanks in advance for your help!

 

Solved Solved
0 4 705
1 ACCEPTED SOLUTION


@Asheetbogo wrote:

How can i achieve that "project-label-values"  (e.g. "Project 1") are saved in "task-table" instead of "project-key-value" (e.g. "abee2625") 


You can't IF you need to keep referential integrity.  In other words, the whole idea of a Ref column is to act as a "pointer" to a specific ROW so that you can get access to any of the columns.  For example, you could use your EnumList column to display an Inline Table view of the Projects.

If all you care about is having the list of "project-label-value" values in the Projects column, then change the EnumList base type to Text and provide a proper expression in the Valid_If for the dropdown to show the "project-label-value" values instead to choose from.

HOWEVER....

Let's say you want to KEEP the EnumList/Ref column as is but STILL want to filter by the "project-label-value" values from the EnumList.  You can do this by including an IN() function in your filter criteria leveraging the EnumList column.  It would look something like this:

...
IN([Project Name], [Project][project-label-value])
...

The [Project][project-label-value], will build a list of the label names. 

View solution in original post

4 REPLIES 4


@Asheetbogo wrote:

How can i achieve that "project-label-values"  (e.g. "Project 1") are saved in "task-table" instead of "project-key-value" (e.g. "abee2625") 


You can't IF you need to keep referential integrity.  In other words, the whole idea of a Ref column is to act as a "pointer" to a specific ROW so that you can get access to any of the columns.  For example, you could use your EnumList column to display an Inline Table view of the Projects.

If all you care about is having the list of "project-label-value" values in the Projects column, then change the EnumList base type to Text and provide a proper expression in the Valid_If for the dropdown to show the "project-label-value" values instead to choose from.

HOWEVER....

Let's say you want to KEEP the EnumList/Ref column as is but STILL want to filter by the "project-label-value" values from the EnumList.  You can do this by including an IN() function in your filter criteria leveraging the EnumList column.  It would look something like this:

...
IN([Project Name], [Project][project-label-value])
...

The [Project][project-label-value], will build a list of the label names. 

hello WillowMobileSys,

thank you so much for your help - Expression for filterning Slice works perfect: (e.g: IN("Project A", [Project][Project]))

in a second step i want to insert a "real column" in my Tasks-Table where i "translate" Project-REFS to Project-Labels (maybe i can also use this Project-Labels-colum for filtering my "Slice" ...

Asheetbogo_0-1665643099174.png     Asheetbogo_1-1665643573210.png

i tried serveral expressions (Auto Compute>App Formula) for "translating" Project-Refs to Project-Labels but i dit not succeed ...

How can i achieve this?

many thanks for help in advance!

PREVIEW
 
 
 

 

You do not need to "translate".  The purpose of a Ref column is a pointer to the ROW so that you can access any of the columns.  This is known as "dereferencing" and you dereference using "dot" notation.

To set your "project label" column in your Tasks table use an expression similar to:

[Project].[Project Label]

 

best thanks for your explanation - i will test it out!