Working on a form to retrieve the multiple values from the checkbox to a single field.
Here is the code i am using. but not able to get the values from the checkbox
var selectedSpecialties = GetFieldValue("SpecialtyField");
console.log('Selected Specialties:', selectedSpecialties);
// Ensure that selectedSpecialties is an array
if (!Array.isArray(selectedSpecialties)) {
selectedSpecialties = [selectedSpecialties];
}
// Convert the array to a comma-separated string
var combinedSpecialties = selectedSpecialties.join(", ");
console.log('Combined Specialties:', combinedSpecialties);
// Set the value of CombinedSpecialtiesField
SetFieldValue("CombinedSpecialtiesField", combinedSpecialties);