List collector variable if i select A country then have A and B to be set in the same variable

srikriti
Tera Contributor

Hi All,

 

I have a scenario there is a list collector variable in catalog item referring to country table if i select US then US and united arab should populated in the same variable  how do i do this can any one guide me on this.

 

 

Thanks,

 

 

11 REPLIES 11

JohnnySnow
Kilo Sage

Hi @srikriti Your requirement is not clear, why do you want to populate United Arab when US is selected? Please elaborate

Thanks
Johnny

Please mark this response as correct or helpful if it assisted you with your question.

Hi @JohnnySnow 

srikriti_0-1691482564960.png

as per the above picture when i select USA in list collector automatically United arab and united states of America should be there right side of sluchbucket on the list collector variable.

i want to have like this once usa selected 

srikriti_0-1691483008799.png

 

Sohail Khilji
Kilo Patron
Kilo Patron

@srikriti ,

 

You have to create a onChange catalog client script on change of Country field. You have to use the for loop to check if you have ''US'' sys_id in any of your array element. if yes then your can add ''UAE'' sys_id to your list collector variable. make sure you append the ''US'' sys_id too else it will over write it.

 

i hope this helps....

 

 

 


☑️ Please mark responses as HELPFUL or ACCEPT SOLUTION to assist future users in finding the right solution....

LinkedIn - Lets Connect

hi @Sohail Khilji  can you provide me script for this i am new to this kind of script.

Thanks