Need help with JavaScript to use Embedded Data to pre-populate a Matrix question | XM Community
Skip to main content
Question

Need help with JavaScript to use Embedded Data to pre-populate a Matrix question


joao.donzelli
Level 1 ●
Forum|alt.badge.img+1

Hello there,

 

 

I'm working on a survey that has a Matrix question, and I'm interested in pre-populating its answers based on embedded data using JavaScript.

 

I've noticed some discussions in this community regarding pre-filling multiple-choice questions with embedded data - which works fine, but I’d like to know if the same approach can be applied to Matrix questions. If so, could anyone share an example of the JavaScript code needed for this?

 

Thanks a lot!

2 replies

TomG
Level 8 ●●●●●●●●
Forum|alt.badge.img+27
  • Level 8 ●●●●●●●●
  • 5938 replies
  • March 25, 2025

Yes, you can use the same approach. Use this.setChoiceValue(statementId, scaleId, true).


joao.donzelli
Level 1 ●
Forum|alt.badge.img+1
  • Author
  • Level 1 ●
  • 4 replies
  • March 27, 2025

Thanks ​@TomG! I'm going to give that a try 😁


Leave a Reply