Dynamic data from a list of options


First post.

I am struggling with selecting dynamically one option from a list.
I have a number of text translated in different languages (English, French, German, Chinese…)
Each text is stored in an “explanation” data type which has the text itself and the language.
The language comes from an options set, and is the primary field for the “explanation” data type.

Now, in a popup, I want to show the explanation which matches the native language which the user has in its profile.

I thought I could use the language of the current user as the index of the explanation list to select the right explanation, but I can’t make it work.

Is it possible ? Is there another way to do it ?

What is your issue, aren’t searching and adding a constraint in it, like current language = current user language?

is not solving it. am I missing something?

you can also set the app language to match the user language from setting > languages. by choosing the field that should match the language


Thanks a lot. Yes, this solves it, that’s what I am doing at the moment. My question is if I can use the current user’s language as index of the explanation list.

The advantage would be that the engine does not need to go through all the explanations (1000s) each time, with an unknown and probably unoptimized algorithm (which is not needed if you can use an index).

But otherwise, it works fine by adding constraints and doing a search on all possible explanations