Tony Chatfield1
Kilo Patron

Hi, unfortunately a partial screenshot doesn't provide any clear details of your configuration, based on your comments I would suspect that field visibility is being controlled by a client script/catalog client script or UI policy

Hi @Tony


I want to populate fields which are associated with List collector field values.
for eg : if a select 'A', 'B' and 'C' in listcollector field then it should display all the associated fields - say a1, b1, c1 which are either select box or checboxes.

I tired creating UI Policies and Client script as well but the issue is once I select a new  value in Application field which is a List collector then the previously associated fields are not visible which should not happend.

Perhaps you could share details of your code and configuration so that the forum can review and assist\advise also it sounds like this is a record producer? if yes details of your record producer and variables would also be helpful.

On change client script :

 

function onChange(control, oldValue, newValue, isLoading) {
    if (isLoading || newValue == '') {
        return;
    }
 
    var str = newValue.toString();
    var arr = str.split(',');
    for (var i = 0; i < arr.length; i++) {
 
        //Common - Basware Alusta
        if (arr[i] == 'c1ebebdc1b6a659820f1dce2b24bcb7e') {
 
            g_form.setDisplay('basware_alusta', true);
        } else {
            g_form.setDisplay('basware_alusta', false);
        }
 
        //Common - Bullhorn
        if (arr[i] == '2edbe3181b6a659820f1dce2b24bcb4f') {
g_form.setDisplay('bullhorn', true);
            g_form.setDisplay('manpower_finland_enterprise_standard_user_default', true);
            g_form.setDisplay('manpower_finland_enterprise_standard_user_canvas', true);
            g_form.setDisplay('manpower_finland_executive_search_free_usertype_separated_account', true);
            g_form.setDisplay('manpower_finland_enterprise_admin_user', true);
        } else {
    g_form.setDisplay('bullhorn', false);
            g_form.setDisplay('manpower_finland_enterprise_standard_user_default', false);
            g_form.setDisplay('manpower_finland_enterprise_standard_user_canvas', false);
            g_form.setDisplay('manpower_finland_executive_search_free_usertype_separated_account', false);
            g_form.setDisplay('manpower_finland_enterprise_admin_user', false);
        }
 
        //Common - Broadbean
        if (arr[i] == '28db2f581baa659820f1dce2b24bcbbb') {
            g_form.setDisplay('broadbean', true);
        } else {
            g_form.setDisplay('broadbean', false);
        }
 
        //Common - Cognos BI
        if (arr[i] == 'a2cb2f581baa659820f1dce2b24bcbba') {
            g_form.setDisplay('audit_ad_group', true);
            g_form.setDisplay('planning_ad_group', true);
            g_form.setDisplay('controller_ad_group', true);
            g_form.setDisplay('staffing_ad_group', true);
        } else {
            g_form.setDisplay('audit_ad_group', false);
            g_form.setDisplay('planning_ad_group', false);
            g_form.setDisplay('controller_ad_group', false);
            g_form.setDisplay('staffing_ad_group', false);
        }
 
        //Common - Direct Billing
        if (arr[i] == '2fbb2f581baa659820f1dce2b24bcbb8') {
            g_form.setDisplay('direct_billing', true);
        } else {
            g_form.setDisplay('direct_billing', false);
        }
 
        //Common - Direct Journal
        if (arr[i] == '15bb2fdc1b6a659820f1dce2b24bcbda') {
            g_form.setDisplay('direct_journal1', true);
        } else {
            g_form.setDisplay('direct_journal1', false);
        }
 
        //Common - Microsoft Dynamics
        if (arr[i] == '96abe3181b6a659820f1dce2b24bcb4e') {
            g_form.setDisplay('microsoft_dynamics_crm', true);
        } else {
            g_form.setDisplay('microsoft_dynamics_crm', false);
        }
 
        //Common - Hubspot
        if (arr[i] == '319b23dc1b6a659820f1dce2b24bcb09') {
            g_form.setDisplay('hubspot', true);
 
        } else {
            g_form.setDisplay('hubspot', false);
        }
 
        //Common - Oracle
        if (arr[i] == 'ec8be3141baa659820f1dce2b24bcb09') {
            g_form.setDisplay('oracle', true);
        } else {
            g_form.setDisplay('oracle', false);
        }
 
        //Common - RightEverywhere or //Common - RightTrack
        if (arr[i] == '5b6b63dc1b6a659820f1dce2b24bcb25' || arr[i] == '5b6b63dc1b6a659820f1dce2b24bcb25') {
            g_form.setDisplay('righteverywhere', true);
            g_form.setDisplay('righteverywhere', true);
        } else {
            g_form.setDisplay('righteverywhere', false);
            g_form.setDisplay('righteverywhere', false);
        }
 
        //Common - Sharepoint Sales
        if (arr[i] == 'e05b63dc1b6a659820f1dce2b24bcb23') {
            g_form.setDisplay('experis_ad_group_gufisp_offercreatorexperis', true);
            g_form.setDisplay('talent_solutions_ad_group_gufisp_offercreatorhro', true);
            g_form.setDisplay('manpower_ad_group_gufisp_offercreator', true);
            g_form.setDisplay('ewd_ad_group_gufisp_offercreator', true);
            g_form.setDisplay('right_ad_group_gufisp_offercreator_right', true);
        } else {
            g_form.setDisplay('experis_ad_group_gufisp_offercreatorexperis', false);
            g_form.setDisplay('talent_solutions_ad_group_gufisp_offercreatorhro', false);
            g_form.setDisplay('manpower_ad_group_gufisp_offercreator', false);
            g_form.setDisplay('ewd_ad_group_gufisp_offercreator', false);
            g_form.setDisplay('right_ad_group_gufisp_offercreator_right', false);
 
        }
    }
}

Hi, looking at your script you are looping through the records in your array and this would mean that the last element checked would dictate what was\was not visible.
IE if 'Basware Alusta' was at index[0] and the array had more than 1 element, then after index[0] the result for 'Basware Alusta' would always be

g_form.setDisplay('basware_alusta', false);

 

Rather than using a loop to evaluate your array content I would leave the array content as a string and use indexOf() to evaluate if the required value exists anywhere in the array.
This way you will get a true or false result regardless of the number of elements in the array or their position within the array. Partial example based on your code.

var str = newValue.toString();

//Common - Basware Alusta
if(str.indexOf('c1ebebdc1b6a659820f1dce2b24bcb7e') != -1) {
	g_form.setDisplay('basware_alusta', true);
} else {
    g_form.setDisplay('basware_alusta', false);
}

//Common - Bullhorn
if(str.indexOf('2edbe3181b6a659820f1dce2b24bcb4f') != -1) {
	g_form.setDisplay('bullhorn', true);
    g_form.setDisplay('manpower_finland_enterprise_standard_user_default', true);
    g_form.setDisplay('manpower_finland_enterprise_standard_user_canvas', true);
    g_form.setDisplay('manpower_finland_executive_search_free_usertype_separated_account', true);
    g_form.setDisplay('manpower_finland_enterprise_admin_user', true);
} else {
    g_form.setDisplay('bullhorn', false);
    g_form.setDisplay('manpower_finland_enterprise_standard_user_default', false);
    g_form.setDisplay('manpower_finland_enterprise_standard_user_canvas', false);
    g_form.setDisplay('manpower_finland_executive_search_free_usertype_separated_account', false);
    g_form.setDisplay('manpower_finland_enterprise_admin_user', false);
}

//add addtitional checks as requred.