How to Add Multiple Language Labels in CSV Files for Select One Type and Search

How to Add Multiple Language Labels in CSV Files for Select One Type and Search

Hi Faisal,

You can add multiple columns in your survey and choices sheet for each language and in the choices sheet enter the name of the column from the csv file that represents label in that particular language.

See the following sample files:

Search_and_select.xlsx (6.1 KB)
fruits.csv (112 Bytes)

Thanks,

Sadiq

2 Likes

Hi @Sadiq_Khoja, your solution is truly great, but I think you might need to force the CSV linking with an initial call, as the CSV resource does not seem recognized on my end otherwise. Or is there another way to handle this?

I am using it with an entity CSV, and I added a hidden question to ensure the CSV resource loads properly with the form; otherwise, I get an error.

image

Another thing is that we may want to retrieve language-specific labels (something similar to jr:choice(${var},'${var}'), while options with CSV require specifying the retrieved label column, but I understand from @Grzesiek2010 in this other thread that it may actually not be feasible

1 Like

This happens only if you combine search appearance with other appearances with hyphen in them. So using columns or minimal with search will work fine but for columns-pack or columns-n you need to add hidden question.

Yes, that's true. jr:choice-name is not supported for select_*_from_file. But you can use xpath expression to retrieve the label e.g: instance('fruits')/root/item[name_key=${fruit}]/name_en for English label and instance('fruits')/root/item[name_key=${fruit}]/name_fr for French label.

2 Likes