or any other accidents/injuries in past 3 months" so this is one of the value in checkbox of google form, so I when i am splitting it using delimiter comma(",") it is splitting comma belong to actual values too, I hope it make sense, can some one help me to resolve this situation so I can get all values in bullet points in google doc without impacting comma thing.
function createPDF_(row,sheet,response)
{
const head = sheet.getRange('1:1').getValues().flat()
const posIncrement = head.indexOf('[Form Publisher] Increment')
const pos_pdfURL = head.indexOf('Response PDF URL')
const FIRST_NAME = response['First Name'][0]
const LAST_NAME = response['Last Name'][0]
const AGREEMENT = response[`*By selecting "I AGREE" below, you confirm the email address you entered above is yours and no other individual has access to your email account. This email address should match the email address where you received the link for this intake.`][0]
const DOB = response['Date of Birth'][0]
const BEST_PHONE_N = response['Best Phone Number'][0]
const MAILING_ADDR = response['Mailing Address'][0]
const CITY = response['City/Town'][0]
const PROVINCE = response['Province'][0]
const POSTAL = response['Postal Code/Zip Code'][0]
const EMERGENCY_CONTACT = response['Emergency Contact Information (Name and Contact #)'][0]
const REFERRING_DOCTOR = response['Referring Doctor or Family Doctor'][0]
const OCCUPATION = response['Occupation'][0]
const EXT_HEALTH = response['Do You Have Extended Health Benefits?'][0]
const AREA_CONCERN = response['What areas are a concern for you?'][0]
const WELLNESS = response['Wellness Check'][0]
const LIMITATION = response['What limitations are you experiencing?'][0]
const MEDICAL_Q = response['Medical Questionnaire (related to the current problem)'][0]
const PAST_MHistory = response[`Past Medical History (Type 'NONE' below if there is no significant medical history)`][0]
const PAST_SURGICAL = response[`Past Surgical History (Type 'NONE' below if there is no significant surgical history)`][0]
const MEDICATION_LIST = response[`Please list all medications you are currently taking (Type 'NONE' below if you are not taking medications)`][0]
const PROBLEM_LEN = response['How long have you been dealing with this problem?'][0]
const SEEN_TYPE = response['Do you prefer to be seen in person or have virtual (online) sessions?'][0]
const today = new Date()
const todays_Date_f = Utilities.formatDate(today,Session.getScriptTimeZone(),"MM dd yyyy")
const timestamp = Utilities.formatDate(today,Session.getScriptTimeZone(),"MM/dd/yyyy hh:mm:ss")
const todaydate = Utilities.formatDate(today,Session.getScriptTimeZone(),"MM/dd/yyyy")
const targetFolder = DriveApp.getFolderById(targetFolderID)
const template = DriveApp.getFileById(templateID)
const docFile = template.makeCopy(`Intake Form_${LAST_NAME}_${FIRST_NAME}`,targetFolder)
const doc = DocumentApp.openById(docFile.getId())
const body = doc.getBody()
const header = doc.getHeader()
/** Logics to replace template literals to actual values */
header.replaceText('<<Timestamp>>',timestamp)
header.replaceText('<<Increment>>',row+5)
body.replaceText('<<Today>>',todaydate)
body.replaceText('<<First Name>>',FIRST_NAME)
body.replaceText('<<AGREEMENT>>',AGREEMENT)
body.replaceText('<<Last Name>>',LAST_NAME)
body.replaceText('<<Date of Birth>>',DOB)
body.replaceText('<<Best Phone Number>>',BEST_PHONE_N)
body.replaceText('<<Mailing Address>>',MAILING_ADDR)
body.replaceText('<<City/Town>>',CITY)
body.replaceText('<<Province/State>>',PROVINCE)
body.replaceText('<<Postal Code/Zip Code>>',POSTAL)
body.replaceText('<<Emergency Contact Information>>',EMERGENCY_CONTACT)
body.replaceText('<<Referring Doctor or Family Doctor>>',REFERRING_DOCTOR)
body.replaceText('<<Occupation>>',OCCUPATION)
console.log(EXT_HEALTH,"---",AREA_CONCERN,"---",LIMITATION,"---",MEDICAL_Q)
body.replaceText('<<Extended Health Benefits>>',EXT_HEALTH)
body.replaceText('<<Area of Concern>>',AREA_CONCERN)
body.replaceText('<<Limitation>>',LIMITATION)
body.replaceText('<<Wellness Check>>',WELLNESS)
body.replaceText('<<Medical Questionnaire>>',MEDICAL_Q)
body.replaceText('<<Past Medical History>>',PAST_MHistory)
body.replaceText('<<Past Surgical History>>',PAST_SURGICAL)
body.replaceText('<<List of Medication>>',MEDICATION_LIST)
body.replaceText('<<Problem Duration>>',PROBLEM_LEN)
body.replaceText('<<Session Type>>',SEEN_TYPE)
body.replaceText('<<Consent>>',CONSENT)
doc.saveAndClose()
var pdfBlob = doc.getAs('application/pdf');
var pdfFile = targetFolder.createFile(pdfBlob);
sheet.getRange(row,posIncrement+1).setValue(row+5)
sheet.getRange(row,pos_pdfURL+1).setValue(pdfFile.getUrl())
docFile.setTrashed(true)
}