Populate values from one field to another field
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-22-2024 11:27 PM
I have 2 fields "Existing groups" & "Remove Existing" and both are of type List Collector. Currently existing groups having values populated with the groups where the user have. I need to have the same values populated in the remove existing field. Please help
Thanks!
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-22-2024 11:34 PM
Hi @Revathi12
You can either write an onChange client script to set the value or the before BR based on your requirement.
onChange CS where you have to select the field as an existing group.
g_form.setValue('remove_existing', newValue);
Or before BR
current.remove_existing = current.existing_group;
Please hit helpful and accepted as a solution if this resolves your query.
Thanks!
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-22-2024 11:35 PM
Hi @Revathi12 ,
You can go with onLoad client script.
function onLoad() {
var existingGroups = g_form.getValue('existing_groups'); // Assuming 'existing_groups' is the field name for "Existing Groups"
var removeExistingField = g_form.getControl('remove_existing'); // Assuming 'remove_existing' is the field name for "Remove Existing"
// Clear existing values in 'Remove Existing' field
removeExistingField.innerHTML = '';
// Populate 'Remove Existing' field with the same values as 'Existing Groups'
if (existingGroups) {
existingGroups.forEach(function(group) {
var option = document.createElement('option');
option.text = group.display_value;
option.value = group.value;
removeExistingField.add(option);
});
}
}
Please mark as Accepted as Solution & hit helpful !!!
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-22-2024 11:51 PM
Hi @Revathi12 ,
Please refer to below article for setting up of dynamic values in list collector by @Ankur Bawiskar ,
Please mark helpful/correct if my response helped you.