How to add rows in a table from external multiple dropdown list?

  • Asked
  • Active
  • Viewed 1543 times
0

Hello, could you help me with this little problem?

I have a multiple seleccion dropdown list and a table in my survey, then I like to create many rows as selected items from the dropdown list and past the values as well as past the values the corresponding values in each row.

Is that possible? Let me know if it's.

Thaks a lot.

1

Accepted answer

Dear user,
The solution is a bit tricky but it's an interesting case to discuss here.
One thing that you could use is the option Auto generate minimum items that you have in the multiple entity definition editor in the Survey Designer; this option works only the first time an entity (or a form containing that) becomes relevant, so you will have to have some condition that will be triggered when all the values of your multiple selection dropdown list are filled.
Also, in the multiple entity you will have to specify the minimum number of items.
Suppose that your multiple attribute is called mult_attr, the expression in Min count will be: count(mult_attr).
Then, you have to define a calculated attribute inside the multiple entity, or an attribute with a default value specified, that takes one of the values of mult_attr as value.
The expression in that calculated attribute will be: parent()/mult_attr[idm:position($context)]
That expression takes a value from mult_attr, using the position of the current row in the multiple entity with the expression idm:position($context).
Here you can find a simple survey with an example of a table with predefined rows

Let us know, many thanks.
Open Foris Team

Your answer

Markdown text. Shortcuts: Ctrl+B bold, Ctrl+I italic, Ctrl+K link, Ctrl+E code, Ctrl+Shift+V paste as plain text. Tab indents list items and code; press Escape, then Tab, to leave the text box.

Insert an image

Say what the image shows, for people who can't see it.

Keyboard shortcuts

Anywhere

?
Show this list
/
Search
g h
Go to the home page
g q
Go to the questions
g t
Go to the tags
g u
Go to the users
a
Ask a question

Lists of questions

j k
Next or previous question
Enter
Open the question

Question pages

j k
Next or previous post

Shortcuts never apply while you type in a text field. Members can turn them off in their preferences.