App icon indicating copy to clipboard operation
App copied to clipboard

[$175] Workspace - No error shown when saving a report field with an invalid formula

Open melvin-bot[bot] opened this issue 1 month ago • 33 comments

Problem

When you save a workspace report field whose default value has an invalid formula, the save fails silently. The new field disappears from the list and no error appears.

Reproducible in production

Yes

Action Performed

  1. Open Workspace settings > Report fields.
  2. Add a report field.
  3. Enter an invalid formula in Default value, such as {field:DoesNotExist}.
  4. Save the report field.

Expected Result

The save fails and the report fields page shows an error explaining that the formula is invalid.

Actual Result

The save fails, but no error is shown. The newly added report field disappears from the list.

Cause

The server correctly rejects the invalid formula. The App then fails to show that rejection:

  1. The report field form doesn't check whether a {field:...} reference points to an existing field, so the request is sent to the server.
  2. When the server rejects it, the App rolls back the optimistic field and stores the error on the policy's errorFields.fieldList.
  3. Nothing on the report fields page reads or displays that error, so the user gets no feedback.

Suggested fix

  • Show the stored errorFields.fieldList error on the report fields page, so server rejections are visible and dismissible.
  • Optionally, validate {field:...} references in the form before saving, so this case is caught client-side.

Workaround

Unknown

Upwork Automation - Do Not Edit
Issue OwnerCurrent Issue Owner: @dukenv0307

melvin-bot[bot] avatar Oct 15 '26 09:10 melvin-bot[bot]

Proposal

Updated 2026-10-22: Updated based on feedback from shubham1206agra. The backend now returns the specific error keyed to the failed field, so this version reads that error and shows it on the field's own row.

Please re-state the problem that we are trying to solve in this issue.

When you save a report field whose default value has an invalid formula, such as {field:DoesNotExist}, the save fails. The new field disappears and no error appears.

What is the root cause of that problem?

The backend now returns the error in this shape. The App already uses this shape for the report title error:

errorFields.fieldList.<fieldKey>.defaultValue.<microtime>: "Formula field {field:DoesNotExist} not recognized"

The App doesn't use it:

  • On failure, createReportField removes the field from policy.fieldList, so its row disappears. It also writes only a generic error to errorFields[fieldKey].
  • In WorkspaceFieldsSection, each row's OfflineWithFeedback gets only pendingAction. Nothing reads errorFields.fieldList[fieldKey] or errorFields[fieldKey].

What changes do you think we should make in order to solve the problem?

Show the error on the failed field's row, as Categories and Tags do.

  1. Keep the failed row. In createReportField's failureData, keep the policy field with pendingAction: ADD instead of setting it to null. Keep removing it from each report's fieldList, as the code does today. Keep the generic errorFields[fieldKey] error as a fallback.
  2. Show the error on the row. In WorkspaceFieldsSection, give each row:
    • errors: the backend error, read with getLatestErrorField({errorFields: policy?.errorFields?.fieldList?.[fieldKey] ?? {}}, 'defaultValue'). If that is empty, use getLatestErrorField(policy, fieldKey).
    • onClose: call a new clearReportFieldErrors(policy, fieldID).
  3. Add clearReportFieldErrors in ReportField.ts:
    • Clear errorFields.fieldList[fieldKey] and errorFields[fieldKey].
    • If the field's pendingAction is ADD, remove it from fieldList. This mirrors clearCategoryErrors.
  4. Keep failed fields off reports. getAvailableReportFields merges every policy field into unsettled reports. Skip policy fields that have pendingAction: ADD and are not on the report already. Optimistic adds are written to each report's fieldList, so they still appear.
  5. Clear errors narrowly. In createReportField and updateReportFieldInitialValue, the optimistic and success data set errorFields: null, which wipes every policy error, including the title error. Clear only {[fieldKey]: null, fieldList: {[fieldKey]: null}}.

updateReportFieldInitialValue already keeps the row and reverts the value on failure. After steps 2 and 3, its server error also appears on the row.

What alternative solutions did you explore? (Optional)

  • Show failures at the top of the section. Keep removing the field, and show any errorFields.fieldList key that has no matching field. This avoids step 4, but the field's name is lost, so the user can't tell which field failed.
  • Validate in the form. Flag unknown {field:X} references in CreateFieldsPage and FieldsInitialValuePage before saving. This is optional now, because the server returns a clear message.
Code references

Next Steps for Contributor+ team: To accept: @MelvinBot implement [this](https://github.com/Expensify/App/issues/104067#issuecomment-6189162199) to create a draft PR. To refine: @MelvinBot <your feedback> To reject: Explain why you are rejecting Melvin's proposal.

MelvinBot avatar Oct 15 '26 09:10 MelvinBot

Triggered auto assignment to Contributor-plus team member for initial proposal review - @shubham1206agra (External)

melvin-bot[bot] avatar Oct 15 '26 09:10 melvin-bot[bot]

Job added to Upwork: https://www.upwork.com/jobs/~022110667854459323263

melvin-bot[bot] avatar Oct 15 '26 09:10 melvin-bot[bot]

Proposal

Please re-state the problem that we are trying to solve in this issue.

When a workspace report field is saved with an invalid formula as its default value (for example {field:DoesNotExist}), the save fails silently. The new field disappears from the list and no error is shown.

What is the root cause of that problem?

Two things combine here:

  1. validateForm in CreateReportFieldsPage checks length, circular references and unsupported {report:...} parts, but not whether a {field:...} reference points to an existing field. The invalid value passes the form and is sent to the server.
  2. When the server rejects it, the failureData in createReportField sets fieldList[fieldKey] to null, which removes the row, and writes the error to errorFields[fieldKey]. The row in WorkspaceReportsPage is rendered in an OfflineWithFeedback with only pendingAction (no errors or onClose), and nothing else on the page reads that error. The row disappears and the error is never displayed.

What changes do you think we should make in order to solve the problem?

Keep the failed row on the page with its error, the same way categories already do it.

  1. In createReportField's failureData, keep the optimistic field with pendingAction: add and set errors on it (generic failure message), instead of setting it to null.
  2. In WorkspaceReportsPage, pass the row's errors and an onClose handler to its OfflineWithFeedback.
  3. Add a clearReportFieldErrors(policyID, fieldKey) action that mirrors clearCategoryErrors. If the field's pendingAction is add, remove it from fieldList. Otherwise, only clear its errors.

The user then sees the failed field with a red error, and clicking the X removes it. This covers every server-side rejection, not just formulas.

What alternative solutions did you explore? (Optional)

Validate the formula in the form before the API call. In validateForm, parse the default value with the existing parse from libs/Formula and show an inline error on the default value input for common invalid cases:

  • {field:X} where no field named X exists in policy.fieldList
  • {field:} with an empty field name
  • an opening { without a matching }

ashu75575 avatar Oct 15 '26 09:10 ashu75575

Proposal

Please re-state the problem that we are trying to solve in this issue.

In Workspace Settings > More features > Report fields, when creating a new report field with an invalid formula default value (e.g. {field:DoesNotExist}), saving the field fails silently. The newly created report field disappears completely from the list and no error message is displayed to the user.

What is the root cause of that problem?

  1. Destructive Failure Data in Action: In src/libs/actions/Policy/ReportField.ts (createReportField, lines 256–268), failureData deletes the optimistic field by setting fieldList: {[fieldKey]: null} while simultaneously writing the failure message to policy.errorFields[fieldKey].
  2. List Rendering Disconnect in WorkspaceFieldsSection.tsx: In src/pages/workspace/fields/WorkspaceFieldsSection.tsx (lines 136–181), menu items are mapped strictly from Object.values(policy.fieldList). Because failureData deleted the field from fieldList, no row exists in the DOM. Furthermore, WorkspaceFieldsSection.tsx never reads policy.errorFields for field keys, nor does it pass errors or an onClose callback to OfflineWithFeedback for field items. Consequently, the error is orphaned in Onyx and the field silently disappears.

What changes do you think we should make in order to solve the problem?

  1. In src/libs/actions/Policy/ReportField.ts: Update createReportField's failureData to retain the field in fieldList with errors attached instead of unmounting it to null, following Expensify's standard pattern (mirrored in Categories and Tags):

    const failureData: Array<OnyxUpdate<typeof ONYXKEYS.COLLECTION.POLICY>> = [
        {
            key: `${ONYXKEYS.COLLECTION.POLICY}${policy?.id}`,
            onyxMethod: Onyx.METHOD.MERGE,
            value: {
                fieldList: {
                    [fieldKey]: {
                        ...optimisticReportFieldDataForPolicy,
                        errors: ErrorUtils.getMicroSecondOnyxErrorWithTranslationKey('workspace.reportFields.genericFailureMessage'),
                    },
                },
            },
        },
    ];
    
  2. In src/pages/workspace/fields/WorkspaceFieldsSection.tsx: In getMenuItems, pass errors={field.errors} and an onClose handler to OfflineWithFeedback for each report field row:

    • When dismissed via onClose, call a helper clearReportField(policyID, fieldKey). If field.pendingAction === CONST.RED_BRICK_ROAD_PENDING_ACTION.ADD, it removes the field from fieldList ([fieldKey]: null); otherwise, it clears errors: null.
  3. In src/libs/actions/Policy/ReportField.ts: Export clearReportField(policyID: string, fieldKey: string) to cleanly dismiss the error and unlink failed optimistic additions from Onyx.

What alternative solutions did you explore? (Optional)

Displaying orphaned errorFields in a banner at the top of WorkspaceFieldsSection. However, keeping the failed item in-line with OfflineWithFeedback (and a red brick road indicator) preserves context for which field failed and provides a consistent UX matching Workspace Categories and Tags.

Contributor details Your Expensify account email: [email protected] Upwork Profile Link: https://www.upwork.com/freelancers/~0170d6b02e9440e604

camesenin avatar Oct 15 '26 10:10 camesenin

✅ Contributor details stored successfully. Thank you for contributing to Expensify!

melvin-bot[bot] avatar Oct 15 '26 10:10 melvin-bot[bot]

Contributor details Your Expensify account email: [email protected] Upwork Profile Link: https://www.upwork.com/freelancers/janithad

Proposal

Please re-state the problem that we are trying to solve in this issue.

In Workspace Settings > Report fields, when adding or editing a report field with a default value formula containing a reference to a non-existent field (e.g. {field:DoesNotExist}), saving fails silently. The newly created report field disappears completely from the list and no error message is displayed to the user.

What is the root cause of that problem?

There are two interrelated root causes spanning client validation and failure handling:

  1. Client-side formula validation ignores {field:...} tokens: In src/pages/workspace/fields/CreateFieldsPage.tsx (validateForm), formula validation only checks for circular references (hasCircularReferences) and unsupported {report:...} parts (getUnsupportedReportFieldFormulaParts). In src/libs/WorkspaceReportFieldUtils.ts (getUnsupportedReportFieldFormulaParts), only tokens of type FORMULA_PART_TYPES.REPORT are checked (if (part.type !== FORMULA_PART_TYPES.REPORT) continue;). Tokens of type FORMULA_PART_TYPES.FIELD are ignored. Therefore, references to non-existent fields like {field:DoesNotExist} pass client-side validation as valid and are dispatched to the server via createReportField.

  2. Destructive failureData & Missing Section Error Display: When the server rejects the invalid formula, the App applies failureData in src/libs/actions/Policy/ReportField.ts (createReportField):

    fieldList: {
        [fieldKey]: null,
    },
    errorFields: {
        [fieldKey]: ErrorUtils.getMicroSecondOnyxErrorWithTranslationKey('workspace.reportFields.genericFailureMessage'),
    },
    

    Setting fieldList[fieldKey]: null removes the optimistic report field completely from policy.fieldList. Meanwhile, src/pages/workspace/fields/WorkspaceFieldsSection.tsx only renders items that exist in policy.fieldList (Object.values(fieldList).filter(...)) and its renderItem only passes pendingAction={item.pendingAction} to OfflineWithFeedback. It never reads or displays policy.errorFields. Consequently, when the server rejects the request, the item is deleted from the UI with zero error message rendered.

What changes do you think we should make in order to solve the problem?

1. Validate {field:...} references on the client (WorkspaceReportFieldUtils.ts & CreateFieldsPage.tsx):

In src/libs/WorkspaceReportFieldUtils.ts, add a helper getInvalidReportFieldFormulaParts(initialValue?: string, fieldList?: Record<string, PolicyReportField>, expectedTarget?: ValueOf<typeof CONST.REPORT_FIELD_TARGETS>):

  • Parse the formula using Formula.parse(initialValue).
  • For parts of type FORMULA_PART_TYPES.FIELD: extract the referenced field name from part.fieldPath[0].
  • Verify whether the referenced field exists in the available fields for this policy and target (using getReportFieldsForTarget(fieldList, expectedTarget) and checking by name or fieldID).
  • If referenced field is missing, return the invalid token(s).

In CreateFieldsPage.tsx -> validateForm:

if ((type === CONST.REPORT_FIELD_TYPES.TEXT || type === CONST.REPORT_FIELD_TYPES.FORMULA) && !!formInitialValue && !errors[INPUT_IDS.INITIAL_VALUE]) {
    const invalidFieldParts = getInvalidReportFieldFormulaParts(formInitialValue, policy?.fieldList, fieldTarget);
    if (invalidFieldParts.length > 0) {
        errors[INPUT_IDS.INITIAL_VALUE] = translate('workspace.reportFields.invalidFormulaFieldReferenceError', invalidFieldParts.join(', '));
    }
}

This catches the error immediately on form submission and displays an inline error under the Default Value field without sending an invalid request to the server.

2. Display server failure errors in WorkspaceFieldsSection.tsx:

In src/pages/workspace/fields/WorkspaceFieldsSection.tsx, wrap the list or section with an OfflineWithFeedback or render a dismissible error banner bound to policy?.errorFields for report fields:

<OfflineWithFeedback
    errors={policy?.errorFields}
    onClose={(errorKey) => clearReportFieldError(policyID, errorKey)}
>
...
</OfflineWithFeedback>

And add clearReportFieldError in ReportField.ts to clear policy.errorFields[fieldKey].

What alternative solutions did you explore?

Only relying on server error display without client validation would create unnecessary network roundtrips and optimistic UI flickering (field appearing and disappearing). Validating on the client side provides immediate UX feedback while adding section error display ensures robustness for any other server-side rejection.

janiya2 avatar Oct 15 '26 11:10 janiya2

✅ Contributor details stored successfully. Thank you for contributing to Expensify!

melvin-bot[bot] avatar Oct 15 '26 11:10 melvin-bot[bot]

Contributor details Your Expensify account email: [email protected] Upwork Profile Link: https://www.upwork.com/freelancers/~01e51b3f9ff738cf94

Proposal

Please re-state the problem that we are trying to solve in this issue.

When creating a workspace report field with an invalid formula default value (such as {field:DoesNotExist}), the form submits the request to the server without validating {field:...} references. When the server rejects the request, the optimistic field is removed from the list and no error message is shown on screen.

What is the root cause of that problem?

  1. Client-Side Formula Reference Validation Gap: In src/pages/workspace/fields/CreateFieldsPage.tsx (validateForm), formula validation calls getUnsupportedReportFieldFormulaParts(formInitialValue). In src/libs/WorkspaceReportFieldUtils.ts, getUnsupportedReportFieldFormulaParts only checks tokens of type FORMULA_PART_TYPES.REPORT ({report:...}) and skips FORMULA_PART_TYPES.FIELD ({field:...}). As a result, references to non-existent fields like {field:DoesNotExist} bypass form validation and are sent to the server.

  2. Unrendered Failure Error on Report Fields Section: When createReportField in src/libs/actions/Policy/ReportField.ts fails on the server, failureData removes the optimistic field (fieldList[fieldKey]: null) and writes the error to policy.errorFields[fieldKey]. Because the field is removed from policy.fieldList, WorkspaceFieldsSection.tsx no longer renders a row for it, and WorkspaceFieldsSection.tsx never passes errors or onCloseError to ToggleSettingOptionRow. The field disappears silently while leaving an orphaned error key on policy.errorFields.

What changes do you think we should make in order to solve the problem?

  1. Validate {field:...} References in src/libs/WorkspaceReportFieldUtils.ts:

    • Update the dynamic require type for FORMULA_PART_TYPES in getUnsupportedReportFieldFormulaParts to {REPORT: string; FIELD: string} and add an optional second parameter availableFields?: Record<string, PolicyReportField>.
    • When part.type === FORMULA_PART_TYPES.FIELD and availableFields !== undefined, extract const [fieldName] = part.fieldPath ?? [] and normalize with const normalizedReferencedName = fieldName?.toLowerCase() (matching the case-insensitive lookup without trimming in Formula.ts:468 and ReportUtils.ts:14962). If !normalizedReferencedName or no field in Object.values(availableFields) has field.name.toLowerCase() === normalizedReferencedName, push part.definition to unsupported.
  2. Enforce Field Reference Validation in CreateFieldsPage.tsx and FieldsInitialValuePage.tsx:

    • In CreateFieldsPage.tsx (validateForm), inside the existing (type === CONST.REPORT_FIELD_TYPES.TEXT || type === CONST.REPORT_FIELD_TYPES.FORMULA) && !!formInitialValue && !errors[INPUT_IDS.INITIAL_VALUE] guard, compute const targetFields = getReportFieldsForTarget(policy?.fieldList, fieldTarget) and pass targetFields into getUnsupportedReportFieldFormulaParts(formInitialValue, targetFields).
    • Apply the same check in FieldsInitialValuePage.tsx (validateForm) behind !errors[INPUT_IDS.INITIAL_VALUE] when reportField?.type is TEXT or FORMULA and !!formInitialValue, passing getReportFieldsForTarget(policy?.fieldList, expectedTarget) into getUnsupportedReportFieldFormulaParts(formInitialValue, targetFields) and setting errors[INPUT_IDS.INITIAL_VALUE] = translate('workspace.reportFields.unsupportedFormulaValueError', unsupportedFormulaParts.join(', ')). Because getReportFieldsForTarget returns {} when policy?.fieldList is empty or undefined, {field:DoesNotExist} is rejected even on workspaces with zero existing fields, while keeping circular reference errors higher priority.
  3. Scope and Render Section Failure Errors in ReportField.ts and WorkspaceFieldsSection.tsx:

    • In src/libs/actions/Policy/ReportField.ts (createReportField), define const sectionErrorKey = isInvoiceField ? 'invoiceFieldsError' : 'reportFieldsError'.
    • In optimisticData and successData, clear errorFields: {[sectionErrorKey]: null} instead of wiping the entire errorFields object (preserving unrelated policy toggle or report title errors).
    • In failureData, set fieldList: {[fieldKey]: null} and write the error exclusively to errorFields: {[sectionErrorKey]: ErrorUtils.getMicroSecondOnyxErrorWithTranslationKey('workspace.reportFields.genericFailureMessage')} (omitting [fieldKey] so dismissing the banner leaves no orphaned red-brick-road badge on the workspace).
    • In src/pages/workspace/fields/WorkspaceFieldsSection.tsx, derive const sectionErrorKey = titleKey === 'workspace.common.invoiceFields' ? 'invoiceFieldsError' : 'reportFieldsError' and pass errors={policy?.errorFields?.[sectionErrorKey] ?? undefined} and onCloseError={() => clearPolicyErrorField(policyID, sectionErrorKey)} to ToggleSettingOptionRow.

What alternative solutions did you explore? (Optional)

I considered scanning policy.errorFields for keys starting with expensify_ that are missing from policy.fieldList. However, because WorkspaceFieldsSection renders both Expense Report Fields and Invoice Fields, and failureData deletes fieldList[fieldKey] (removing field.target), prefix scanning cannot distinguish whether a failed creation belonged to Expense Report Fields or Invoice Fields. I also considered keeping rejected fields inside policy.fieldList with pendingAction: ADD, but retaining server-rejected entries in policy.fieldList exposes invalid fields to downstream pickers and formula resolvers. Dedicated reportFieldsError and invoiceFieldsError keys isolate both sections cleanly.

Test Plan

Preconditions:

  • Log into an account with admin access to a Control workspace with Report Fields enabled.

Manual Verification:

  1. Navigate to Workspace settings > Report fields > Add report field, set Type to Formula, enter {field:DoesNotExist} as the Default value, and click Save. Verify an inline error ("Formula field {field:DoesNotExist} not recognized") blocks submission without sending a network request.
  2. Create a text field named Department, then create a formula field with {field:department} and verify case-insensitive matching succeeds. Edit its initial value to {field:Ghost} and verify inline validation blocks saving.
  3. Simulate a server failure on CreatePolicyReportField and verify the error banner appears on the Report Fields section header, does not bleed into Invoice Fields, and clears cleanly with no residual workspace RBR badge when dismissed.

Regression Verification:

  1. Verify circular reference formulas still display the circular reference error first.
  2. Verify existing report field creation, initial value editing, deletion, and report title settings (errorFields.fieldList) continue working without regressions, and run npm run test tests/unit/WorkspaceReportFieldUtilsTest.ts.

taieddie avatar Oct 15 '26 14:10 taieddie

✅ Contributor details stored successfully. Thank you for contributing to Expensify!

melvin-bot[bot] avatar Oct 15 '26 14:10 melvin-bot[bot]

@shubham1206agra I reproduced this and wanted to share a few concerns with MelvinBot's proposal:

  1. Detached top banner instead of Pattern B: Melvin filters policy.errorFields for expensify_ keys to show a floating banner at the top of the page. In Expensify (like Categories and Tags), errors always belong directly on the item's own row.
  2. Duplicated parsing & extra translation: Melvin copy-pastes custom formula parsing into two page files and adds a new translation, instead of reusing our existing getUnsupportedReportFieldFormulaParts helper and translation.
  3. Melvin took a shortcut: Melvin even noted in its alternatives that keeping the failed field in fieldList (standard Pattern B) is the right way, but skipped it.

The Clean Fix:

  1. Standard Pattern B UX: Keeps the failed field in fieldList so the error and dismiss (X) button show directly on its own row (like Categories and Tags), avoiding floating top banners and key-sniffing.
  2. Centralized validation & zero new keys: Reuses the existing getUnsupportedReportFieldFormulaParts helper and translation for {field:...} validation, without duplicate parsing code across pages. Would you like me to post the full proposal?

Repro demo :

https://github.com/user-attachments/assets/8854d32b-9dde-4e9f-8c79-290112cc35e1

Fix demo

https://github.com/user-attachments/assets/58ec4695-cbac-469c-bf85-def0038c80cf

emkhalid avatar Oct 16 '26 13:10 emkhalid

This looks like something we need to change in BE to send errors in fieldList directly as otherwise we can't identify from which we got this error.

shubham1206agra avatar Oct 18 '26 13:10 shubham1206agra

https://github.com/Expensify/App/issues/104067#issuecomment-6250749843

Please add internal label as we need to add errors in fieldList policy object to find the exact error.

:ribbon::eyes::ribbon: C+ reviewed

shubham1206agra avatar Oct 19 '26 05:10 shubham1206agra

Triggered auto assignment to @flodnv, see https://stackoverflow.com/c/expensify/questions/7972 for more details.

melvin-bot[bot] avatar Oct 19 '26 05:10 melvin-bot[bot]

@shubham1206agra Thanks for the feedback! I investigated further and wanted to share what I found, as this might be cleaner and safer to handle 100% on the Frontend without requiring Backend changes:

1. All validation data already exists in the Frontend

A formula {field:X} can only reference report fields on the current workspace. The Frontend already holds the complete list of workspace fields in Onyx under policy.fieldList:

Image

In fact, CreateFieldsPage already uses policy?.fieldList client-side to detect circular references. We can safely check {field:...} references against that exact same list right on the form. This gives users immediate inline feedback (Formula field {field:...} not recognized) without waiting for or sending an invalid request to the server.

https://github.com/Expensify/App/blob/1400f77a313feeee09b53aaf8304867f89ce4cf3/src/pages/workspace/fields/CreateFieldsPage.tsx#L124-L129

2. The failure error is generated by Frontend failureData

When the server rejects a request, the BE does not set policy.errorFields. It is actually the Frontend’s own failureData in ReportField.ts that deletes the field from fieldList and writes the error to policy.errorFields[fieldKey]:

https://github.com/Expensify/App/blob/1400f77a313feeee09b53aaf8304867f89ce4cf3/src/libs/actions/Policy/ReportField.ts#L256-L268

Because the Frontend created the field optimistically, it already knows the exact fieldKey.

If we update failureData to retain the field with pendingAction: ADD (matching Expensify's standard Pattern B used in Categories and Tags), the failed field stays visible with its red error and an X dismiss button directly on its row.


Working Demo (FE-Only Fix):

Here is a quick demo showing the inline validation catching {field:DoesNotExist} immediately on the form, keeping the UI clean and preventing ghost submissions:

https://github.com/user-attachments/assets/aa303aff-d14a-4841-aa39-fabf4730520f

I have tested this FE-only fix and it resolves both the silent vanishing and the formula validation cleanly. If this approach looks good to you, I would be happy to post the full proposal!

emkhalid avatar Oct 19 '26 07:10 emkhalid

@emkhalid Sorry, but your assertion is wrong. Check the response of the API

shubham1206agra avatar Oct 19 '26 08:10 shubham1206agra

@shubham1206agra Thank you for pointing that out, you are right!

I checked the API response in DevTools and see that the backend's onyxData does indeed return the error under: "errorFields": { "fieldList": { ... } }

I completely understand your point now: because the backend merges the error onto fieldList generically rather than keying it to the specific field ID (even though it's present under data), the Frontend has no way to map the server rejection to an individual field row.

emkhalid avatar Oct 19 '26 13:10 emkhalid

@MelvinBot create an issue in E/E then assign me

dukenv0307 avatar Oct 20 '26 03:10 dukenv0307

Done, dukenv0307. I created an internal issue for the backend change and assigned it to you.

It asks the backend to return report field save errors keyed to the specific field, not the generic errorFields.fieldList key. The App can then show the error on the failed field's row.


view run

MelvinBot avatar Oct 20 '26 04:10 MelvinBot

BE PR is deployed to staging

dukenv0307 avatar Oct 22 '26 02:10 dukenv0307