Page 1 of 3

dynamic value set from single response to multiple response

Posted: September 29th, 2019, 2:09 pm
by prabhustat
Hi,

I want to adopt dynamic value set from single response to multiple response, i.e if suppose a single response variable

value = X1
value = X2
Value = X3

Selected X1

then only display other than selected values in multiple response

X2
X3.



Thanks in advance,

Prabhu

Re: dynamic value set from single response to multiple response

Posted: September 30th, 2019, 5:15 pm
by aaronw
Take a look at the blog post Dynamic Value Sets With the ValueSet Object. The approach taken in Iterate Through Value Set Codes and Labels makes sense for the example you described.

Re: dynamic value set from single response to multiple response

Posted: October 2nd, 2019, 3:07 am
by prabhustat
Thanks it works well for two variables, but if we have more than two variables, dynamic options, shows the first variable options.

With regards,

Prabhu

Re: dynamic value set from single response to multiple response

Posted: October 2nd, 2019, 5:42 pm
by aaronw
You need to declare the valueset globally. I have attached a demo project.

/edit Attachment removed. See my first post on the second page.

Re: dynamic value set from single response to multiple response

Posted: October 2nd, 2019, 6:03 pm
by htuser
Hi Aaron,
Thanks a lot for this example. However it have a bug. When i return to change, correct or modify something after first choice, it doesn't display popup window for choice in field 2 or field 3.
Vs_error.jpg
Vs_error.jpg (72.22 KiB) Viewed 5180 times

Re: dynamic value set from single response to multiple response

Posted: October 3rd, 2019, 4:04 pm
by aaronw
I'm not able to reproduce what you're seeing. However, when I create a demo I sometimes don't associate an input data file (for convenience). See if you have any issues with this new attachment.

/edit Attachment removed. See my first post on the second page.

Re: dynamic value set from single response to multiple response

Posted: October 3rd, 2019, 6:07 pm
by htuser
Dear Aaron,
I always detect issue. It's very easy to detect it:
1.- Fill all fields: FIELD_1, FIELD_2, FIELD_3;
2.- Dont Accept this case and Change, modify FIELD_1 choice;

and, issue will occur. It will not show the popup choice for FIELD_2...and you'll be blocked with
WARNING: Out of range! Please enter a valid value for FIELD_2.

If you can't reproduce it, i'll send a video to you.
Please let me know.
Best,

Re: dynamic value set from single response to multiple response

Posted: October 4th, 2019, 10:08 pm
by aaronw
Thanks, I see the problem. I've attached a corrected implementation. Let me know if you have any questions.

/edit Attachment removed. See my first post on the second page.

Re: dynamic value set from single response to multiple response

Posted: October 4th, 2019, 10:22 pm
by htuser
Thank you Aaron.
It work finely.
But i would like to know if first examples issues related to a conception problem of valueset objects so that you use a programming
workaround to fix it or no?
Best Regards,

Re: dynamic value set from single response to multiple response

Posted: October 5th, 2019, 1:11 am
by Win Ko Ko
I would like to know about valueset for multiple response.
Your demo version is fine for single response.
When all field are multiple responses.

field_1: a, b , c
when field_1 is answered with a and b
then field_2 display only c.

How can i control those multiple responses. Thank.