Multiple choice question - how to write in word template?

Hello,

I am searching for an answer on how I have to write the text for a multiple choice question in word. If I write it as a single choice questions, following error appears: “Error in condition: Cannot compare a list with a single value”. At the moment it looks as follows:

I need to be able to select several Options, and all of them appear in the final word documents.

Thank you!
Marion

Hi Marion,

For the below answer, I have assumed that the question itself enables the user to select more than one option.

The syntax for the Word document would then be as follows:

The @enumerate-and special function takes a list (e.g. in this case from a question with the identifier lender), turns it into an enumeration, and additionally automatically precedes the final entry with the word “and”.

For example, if you would insert the texts “Lender A”, “Lender B” and “Lender C” in the question, the final result would look as follows: “Lender A, Lender B and Lender C”.

As a final note: this answer assumes that the final result can exactly mirror the values inserted in the question. If there is need for conditional logic (e.g. if the user inserts “Lender A”, “Text X” should be the output in the document), then we would need to change the above coding. Let me know if that is the case!

Dear Robbert,

Thank you!! That’s already helpful.

It would be the case that for each option, I would have a ‘text x’ output and not the exact values inserted in the questionnaire. Also, I would use that Multiple choice several times in the documents with different ‘text outputs’.

Is that possible?

Thanks,
Marion

Dear @robbert.jacobs

Thanks again for your previous reply.

If possible, do you know the answer to the discussed scenario?

Greetings

Hi Marion,

I am afraid there is no simple solution to this. The solution I am suggesting below will work in ClauseBuddy, but you are here reaching the limit of what is possible in ClauseBuddy. If more flexibility is required, it may be interesting to consider switching to Clause9 where all of this (and much more) is possible and, above all, easier to build & maintain.

Those considerations aside, the below text (when marked in cyan, of course) will output an enumeration as above with the relevant lenders when selected in a question with identifier @lender.
@enumerate-and(@list(@when(“lender A” in @lender, “Lender A”), @when(“lender B” in @lender, “Lender B”), @when(“lender C” in @lender, “Lender C”)))

In addition, this snippet can be adapted in other contexts, by modifying “Lender A”, “Lender B”, and/or “Lender C” in the snippet to the text that should be shown in that other context if the relevant lender is selected.

E.g. a different representative for either A, B or C:
@enumerate-and(@list(@when(“lender A” in @lender, “John Smith”), @when(“lender B” in @lender, “Jane Smith”), @when(“lender C” in @lender, “Winston Churchill”)))

Hi Robbert,

Thank you! This worked. :pray:

Best,
Marion