USERSETTINGS and Virtual Columns

Hello everyone.

I need help about USERSETTINGS and Virtual Columns.

I am creating an App that works with different languages.

In a table I have the following columns: TypeID, Type1, Type2, Type3. Each column belongs to a language.
The Key is TypeID and the Label is a Virtual Column with the following expression:

SWITCH(USERSETTINGS(ID),
1, [_THISROW].[TYPE0],
2, [_THISROW].[TYPE2],
3, [_THISROW].[TYPE3],
FALSE)

The result is always FALSE. It is read by the USERSETTINGS ID. If I do the test with "Test" it works fine, but when I put the column in DETAILS, the result that appears is FALSE

If USERSETTINGS cannot be used in VCs... What can I do?

Thank you for your help, greetings to the Community

0 15 182
15 REPLIES 15

Remove the [_THISROW] part and it should work

I've already tried it and it doesn't work either.
The problem is that it does not evaluate the expression SWITCH(USERSETTINGS(ID), ....
Since this table is a REF of the main table, I have tried creating a VC in the main table and it does not work with USERSETTINGS

So.. I assume you have a parent, child  and translation table, right? If the structure is like that, add the VC column to your language table. Lets call that column name as "Label". Then if you for example wants to translate the column header name, use LOOKUP("YourColumnName",Translations,KeyColumn,Label) with the "Display name" option.

That is not the problem. The "Label" evaluates it perfectly.
The problem is selecting a certain column from another table based on the USERSETINGS(ID). "ID" being the language.
If ID=1, it will read the TYPE1 column, if it is 2 it will read TYPE2......

This is what I'm using with the virtual column in Translations table..
SWITCH(ANY(_Per User Settings[DeviceLanguage]),
ENG,[ENG],
SWE,[SWE],
NOB,[NOB],
FIN,[FIN],
TUR,[TUR],
HIN,[HIN],
[ENG]
)

I have also tried putting this:

SWITCH(ANY(_Per User Settings[ID]),
0, [TIPO0],
2, [TIPO2],

It doesn't work either.
It's like it doesn't read the value of USERSETTINGS(ID) in the VC

Try to change the ID column name if that could be the reason.

I have also done it..... and nothing

Has anyone had the same thing happen to me?
I have tried everything and there is no way.
USERSETTINGS values are not available in virtual columns

I made a quick test and for me it works just fine with your setup as fa as I have understood it. Any chance your column types doesn't match as you are using a number?

The columns are TEXT

This is the setup I used

AleksiAlkio_0-1706780127156.png

AleksiAlkio_1-1706780172536.png

AleksiAlkio_2-1706780264099.png

 

 

I appreciate your effort...
I've tried EVERYTHING. Still not reading USERSETTINGS(ID). It always returns the last value.
Thank you

Without seeing the app template, I'm running out of ideas why it doesn't work for you. It's a very simple functionality.

Andres_Belmonte_0-1706784818131.png

Andres_Belmonte_4-1706784975728.png

 

Andres_Belmonte_1-1706784873864.pngAndres_Belmonte_2-1706784915981.pngAndres_Belmonte_3-1706784935809.png

Andres_Belmonte_5-1706785032846.pngAndres_Belmonte_6-1706785113464.png

If you click on "Test" it does work

Top Labels in this Space