Hi Graeme,
I'll do my best to share some details which may be helpful.
- It looks like you have Sharepoint List data source driving a multi select question in the form (ie. each item in your sharepoint list will be available to select in the multi select question)
- The handlebars code you have loops over each selected answer value in the multi select (ie. all the selected locomotive codes), and outputs a CSV line fore each code selected. So if 3 values were selected in the multi select, they'd get a CSV output looking something like:
EmployeeID, LocomotiveCode 1, 2024-01-01, , , insert
EmployeeID, LocomotiveCode 2, 2024-01-01, , , insert
EmployeeID, LocomotiveCode 3, 2024-01-01, , , insert
Your handlebars code today references the LocomotiveClass (multi select question) by:
dataRecord.pages.Assessments.sections.LocomotiveClass.answers.LocomotiveClass.valuesMetadata
This would look something like the following in your forms (pages & question tab):

- Assessments= The page ID
- LocomotiveClass=The section ID
- LocomotiveClass= The question ID
If you're looking to apply this handlebars document to a different form or question, you'll want to update the code to reference the new page, section, and question IDs.
Hope this helps! If you are in need of some additional help we do have a professional services team available to discuss in more detail.
Cheers,
Scott
------------------------------
Scott Daly
Senior Manager, Implementation Services
TrueContext
------------------------------