Assign label from choices sheet to a calculated value

I have a list of 12 parts that I need information about. So I set up a repeat group with 12 as the repeat count. Then within the repeat group, I created a calculation to get the current repeat count (part_id). part_id corresponds with values in the choices sheet, where 1 = “1. Air intake with filter”, 2 = “2. Air compressor”, etc. I tried to create another calculation to get the corresponding part name by matching the part_id with the choices sheet, but I have been unable to make it work. The reason I need this is I want to reference the part name in the text of the following questions about make and model of the part. For now, I can get it to show Part 1, 2, 3, etc., so I know the repeat count calculation is working.

To get to this point, I’ve looked at a number of different sources. The best one that most accurately describes my situation is: Follow-ups: Asking follow-up questions for a list of selected items.

I’ve also included a link to my form here for reference: https://fhi360web-my.sharepoint.com/:x:/g/personal/sarchie_fhi360_org/EZPm_Wbxx8hKiX2lZaF2dVUBFx19UnkkbQvkObBrj2EiGQ?e=KAmfcg. The rows applicable to my issue are 106-122.

Do you have suggestions on how I can get the name rather than the value to appear?

Hello @sarchie23,
If you only have 12 fixed options you could set it with a calculation (directly as a readonly field or via a calculate variable), with a cascading if- clause based on the number. If(${part_id} = 1, “LabelOneText”, if(…)).

You might also make 12 adapted notes, each filtered by an exclusive relevant, e.g. ${part_id} = 1.

You could also create a select_one (read-only) and set it by dynamic calculation to the current (part =choice) number and then get the label with jr:choice-name. But this seems more complex and you cannot hide the select_one variable.

3 Likes