
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-30-2024 08:35 AM - edited 09-30-2024 08:36 AM
Hello Community,
I have some yes/no questions and also a separate question (dropdown, single line text, or if someone has a recommendation.
I need the separate question (sensitivity_level) to automatically be answered based on the yes or no questions. How can I go about this as I am learning more scripting functionality on the platform.
If is_this_information_intended_for_public_sharing =yes
make sensitivity_level = PUBLIC
If is_this_information_for_internal_use_by_employees_only =yes
make sensitivity_level = INTERNAL USE ONLY
If does_the_information_included_sensitive_memeber_data_such_as_personal =yes
make sensitivity_level = CONFIDENTIAL
If could_the_authorized_disclosure_of_this_information_result =yes
make sensitivity_level = HIGHLY CONFIDENTIAL
If does_this_information_require_encryption =yes
make sensitivity_level = HIGHLY CONFIDENTIAL
If is_this_information_regulated_by_laws_or_subject_to_compliance_audits =yes
make sensitivity_level = REGULATORY
***This will need to be an OnChange script***
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-30-2024 08:44 AM
Hi @Andrew Meza ,
Here is the example of Catalog onchange script, you can modify the variable's values accordingly.
function onChange(control, oldValue, newValue, isLoading) {
if (isLoading || newValue === '') {
return;
}
// Fetch values of all yes/no questions
var publicSharing = g_form.getValue('is_this_information_intended_for_public_sharing');
var internalUse = g_form.getValue('is_this_information_for_internal_use_by_employees_only');
var sensitiveMemberData = g_form.getValue('does_the_information_included_sensitive_memeber_data_such_as_personal');
var authorizedDisclosure = g_form.getValue('could_the_authorized_disclosure_of_this_information_result');
var requiresEncryption = g_form.getValue('does_this_information_require_encryption');
var regulatedByLaws = g_form.getValue('is_this_information_regulated_by_laws_or_subject_to_compliance_audits');
// Determine the sensitivity level based on conditions
var sensitivityLevel = '';
if (publicSharing == 'yes') {
sensitivityLevel = 'PUBLIC';
} else if (internalUse == 'yes') {
sensitivityLevel = 'INTERNAL USE ONLY';
} else if (sensitiveMemberData == 'yes') {
sensitivityLevel = 'CONFIDENTIAL';
} else if (authorizedDisclosure == 'yes' || requiresEncryption == 'yes') {
sensitivityLevel = 'HIGHLY CONFIDENTIAL';
} else if (regulatedByLaws == 'yes') {
sensitivityLevel = 'REGULATORY';
}
// Set the sensitivity level field value
if (sensitivityLevel !== '') {
g_form.setValue('sensitivity_level', sensitivityLevel);
}
}
Regards,
Pradeep
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-30-2024 08:44 AM
Hi @Andrew Meza ,
Here is the example of Catalog onchange script, you can modify the variable's values accordingly.
function onChange(control, oldValue, newValue, isLoading) {
if (isLoading || newValue === '') {
return;
}
// Fetch values of all yes/no questions
var publicSharing = g_form.getValue('is_this_information_intended_for_public_sharing');
var internalUse = g_form.getValue('is_this_information_for_internal_use_by_employees_only');
var sensitiveMemberData = g_form.getValue('does_the_information_included_sensitive_memeber_data_such_as_personal');
var authorizedDisclosure = g_form.getValue('could_the_authorized_disclosure_of_this_information_result');
var requiresEncryption = g_form.getValue('does_this_information_require_encryption');
var regulatedByLaws = g_form.getValue('is_this_information_regulated_by_laws_or_subject_to_compliance_audits');
// Determine the sensitivity level based on conditions
var sensitivityLevel = '';
if (publicSharing == 'yes') {
sensitivityLevel = 'PUBLIC';
} else if (internalUse == 'yes') {
sensitivityLevel = 'INTERNAL USE ONLY';
} else if (sensitiveMemberData == 'yes') {
sensitivityLevel = 'CONFIDENTIAL';
} else if (authorizedDisclosure == 'yes' || requiresEncryption == 'yes') {
sensitivityLevel = 'HIGHLY CONFIDENTIAL';
} else if (regulatedByLaws == 'yes') {
sensitivityLevel = 'REGULATORY';
}
// Set the sensitivity level field value
if (sensitivityLevel !== '') {
g_form.setValue('sensitivity_level', sensitivityLevel);
}
}
Regards,
Pradeep

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-30-2024 09:16 AM
Thank you for this. Am I setting this up correct? At the moment it is not working like intended.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-30-2024 09:32 AM
Hi @Andrew Meza ,
Make sure all the backend values are mapped correctly to the script.
Choose the Variable name as the first yes/no question field (for example, is_this_information_intended_for_public_sharing) below the OnChange.
Regards,
Pradeep