diff --git a/src/pages/workspace/reportFields/CreateReportFieldsPage.tsx b/src/pages/workspace/reportFields/CreateReportFieldsPage.tsx index 2f9b762458bf..af96aff6a7a8 100644 --- a/src/pages/workspace/reportFields/CreateReportFieldsPage.tsx +++ b/src/pages/workspace/reportFields/CreateReportFieldsPage.tsx @@ -81,7 +81,9 @@ function CreateReportFieldsPage({ errors[INPUT_IDS.TYPE] = translate('workspace.reportFields.reportFieldTypeRequiredError'); } - if (type === CONST.REPORT_FIELD_TYPES.TEXT && formInitialValue.length > CONST.WORKSPACE_REPORT_FIELD_POLICY_MAX_LENGTH) { + // formInitialValue can be undefined because the InitialValue component is rendered conditionally. + // If it's not been rendered when the validation is executed, formInitialValue will be undefined. + if (type === CONST.REPORT_FIELD_TYPES.TEXT && !!formInitialValue && formInitialValue.length > CONST.WORKSPACE_REPORT_FIELD_POLICY_MAX_LENGTH) { errors[INPUT_IDS.INITIAL_VALUE] = translate('common.error.characterLimitExceedCounter', { length: formInitialValue.length, limit: CONST.WORKSPACE_REPORT_FIELD_POLICY_MAX_LENGTH,