dynamic value set from single response to multiple response

Discussions about CSEntry
prabhustat
Posts: 51
Joined: March 17th, 2012, 10:46 am

dynamic value set from single response to multiple response

Post by prabhustat » September 29th, 2019, 2:09 pm

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

aaronw
Posts: 208
Joined: June 9th, 2016, 9:38 am
Location: Washington, DC

Re: dynamic value set from single response to multiple response

Post by aaronw » September 30th, 2019, 5:15 pm

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.

prabhustat
Posts: 51
Joined: March 17th, 2012, 10:46 am

Re: dynamic value set from single response to multiple response

Post by prabhustat » October 2nd, 2019, 3:07 am

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

aaronw
Posts: 208
Joined: June 9th, 2016, 9:38 am
Location: Washington, DC

Re: dynamic value set from single response to multiple response

Post by aaronw » October 2nd, 2019, 5:42 pm

You need to declare the valueset globally. I have attached a demo project.

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

htuser
Posts: 426
Joined: December 19th, 2011, 6:26 pm
Location: HAITI

Re: dynamic value set from single response to multiple response

Post by htuser » October 2nd, 2019, 6:03 pm

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 962 times

aaronw
Posts: 208
Joined: June 9th, 2016, 9:38 am
Location: Washington, DC

Re: dynamic value set from single response to multiple response

Post by aaronw » October 3rd, 2019, 4:04 pm

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.

htuser
Posts: 426
Joined: December 19th, 2011, 6:26 pm
Location: HAITI

Re: dynamic value set from single response to multiple response

Post by htuser » October 3rd, 2019, 6:07 pm

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,

aaronw
Posts: 208
Joined: June 9th, 2016, 9:38 am
Location: Washington, DC

Re: dynamic value set from single response to multiple response

Post by aaronw » October 4th, 2019, 10:08 pm

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.

htuser
Posts: 426
Joined: December 19th, 2011, 6:26 pm
Location: HAITI

Re: dynamic value set from single response to multiple response

Post by htuser » October 4th, 2019, 10:22 pm

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,

Win Ko Ko
Posts: 3
Joined: April 23rd, 2019, 8:18 am

Re: dynamic value set from single response to multiple response

Post by Win Ko Ko » October 5th, 2019, 1:11 am

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.

Post Reply