General Discussion

  • 1.  Handlebars

    Adopter
    Posted 26 days ago

    Hello.

    I am trying to set up handlebars to reference a Microsoft list depending on a choice between two codes, via a "Multiselect from Data Sources"

    This is way outside my knowledge, and I have had help from our IT department previously to set this up, but they are gone.

    I am not sure if the list is wrong or the handlebar, I copied from another set-up document and edited to reference my new list. (changed "Locomotive" to "Wagon", shown below)

    I am totally lost, any help would be great.

    {{#each dataRecord.pages.Assessments.sections.WagonClass.answers.WagonClass.valuesMetadata}}
    {{answers.EmployeeID.[0]}},{{this.display}},{{pf:dateTimeFormat answers.Date.0 "yyyy-MM-dd"}},,,insert
    {{/each}}



    ------------------------------
    Graeme Murphy
    Training Coordinator
    One Rail Australia
    ------------------------------


  • 2.  RE: Handlebars

    Staff
    Posted 26 days ago

    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):

    image

     

    • 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
    ------------------------------



  • 3.  RE: Handlebars

    Adopter
    Posted 23 days ago
    Edited by Graeme Murphy 23 days ago

    Hi Scott.

    I would like to thank you with all of my remaining sanity. 😉

    Your information has been instrumental in guiding me through to a successful deployment of my first "multi-choice and Microsoft List" driven form.

    The last piece of the puzzle was to set the "Column value" correctly - and hey presto.... It worked.

    Again, thank you for helping.



    ------------------------------
    Graeme Murphy
    Training Coordinator
    One Rail Australia
    ------------------------------



Reminder: Content posted to our Community is public content.  Please be careful not to post Intellectual Property that you do not have permission to share.  For more information please refer to our Terms Of Use