You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
[Due for payment 2026-04-23] [$250] Report - Formula report field initial value {report:i} is not persisted & resets to {report:id} #79855
Tap initial value and change it to {report:i} and save
Enter a name and save
Created report field is not shown in list
Tap add field
Enter a name, select type formula and save
Tap the report field created
Tap initial value and change it to {report:i} and save
Note reverts to original as {report:id}
Expected Result:
User should not be allowed to save an unsupported formula value OR
App should show a clear validation error for {report:i}.
If saved, the formula report field should:
Appear in the fields list
Retain {report:i} when reopened or edited
Actual Result:
App allows saving {report:i} without any validation.
The created report field does not appear in the fields list.
When editing the report field, {report:i} automatically reverts back to {report:id} without user action or warning.
Please re-state the problem that we are trying to solve in this issue.
User should not be allowed to save an unsupported formula value OR
App should show a clear validation error for {report:i}.
If saved, the formula report field should:
Appear in the fields list
Retain {report:i} when reopened or edited
What is the root cause of that problem?
The UI does not validate formula placeholders/tokens in the “Initial value” input. So unsupported tokens like {report:i} get submitted. The backend then normalizes/rejects/ignores unsupported formula parts (e.g., reverting to a supported default like {report:id}), leading to inconsistent UI state (missing field / unexpected value changes) without any user-facing error.
What changes do you think we should make in order to solve the problem?
Add client-side validation for report-field formulas that rejects unsupported {report:*} tokens (including {report:i}) and shows a clear inline validation error, preventing save.
Apply this validation in both places users can set the initial value:
Create report field flow
Edit initial value flow
Add a dedicated translation string for the validation message so the UI clearly communicates what’s wrong and suggests a supported token (e.g., {report:id}).
Please re-state the problem that we are trying to solve in this issue.
When creating or editing a formula report field, users can enter unsupported placeholders like {report:i} without any validation. This causes:
Created fields don't appear in the fields list
Invalid values silently revert to {report:id} without warning
No error message shown to users
What is the root cause of that problem?
The root cause is missing client-side validation for formula field placeholders. The app doesn't validate whether a formula uses supported placeholders (like {report:id}) or unsupported ones (like {report:i}) before attempting to save, leading to:
No validation error shown to users for invalid formulas
Server-side auto-correction that silently changes values without user feedback
Fields not appearing in the list when invalid formulas are saved
What changes do you think we should make in order to solve the problem?
Add client-side validation to check formula placeholders before saving. The solution includes:
1. Formula Validation Function (App/src/libs/Formula.ts)
Added getSupportedReportFields() function that returns a list of all supported report field placeholders: id, status, expensescount, type, startdate, enddate, total, reimbursable, currency, policyname, workspacename, created, submit, autoreporting
Added validateFormula() function that parses the formula and checks if all placeholders are in the supported list
Returns an object with isValid boolean and unsupportedPlaceholders array
Exports both functions for use in other components
Added same validation logic in the validateForm callback when creating new formula fields
Shows validation error before field creation
4. Translation Support (App/src/languages/params.ts)
Added InvalidFormulaErrorParams type with placeholders: string property
Exported the type for use in language files
5. Error Messages (All language files)
Added invalidFormulaError translation string to en.ts and all other language files (es.ts, pt-BR.ts, de.ts, fr.ts, it.ts, ja.ts, nl.ts, pl.ts, zh-hans.ts)
Message displays which placeholders are invalid and suggests supported ones like {report:id}, {report:name}, {report:created}
Imported InvalidFormulaErrorParams type in all language files
changed the title [-]Report - Formula report field initial value {report:i} is not persisted & resets to {report:id}[/-][+][$250] Report - Formula report field initial value {report:i} is not persisted & resets to {report:id}[/+]on Jan 20, 2026
Restate the problem this issue is trying to solve.
Formula report fields let unsupported {report:*} placeholders (e.g., {report:i}) be saved; the server normalizes or drops them, so the field disappears from the list and the value reverts without warning on reopen.
What is the root cause of that problem?
Shared policy actions (createReportField/updateReportFieldInitialValue in src/libs/actions/Policy/ReportField.ts) never validate report-formula placeholders—they optimistically persist any string and only infer type from brace presence. Unsupported tokens reach the API, which mutates/drops them, violating the guarantee that persisted initial values use only supported formula tokens.
What changes do you think we should make in order to solve the problem?
Enforce this rule:
“A workspace report field initial value is saved only if all {report:*} placeholders are supported by the Formula evaluator.”
Add validation in Policy/ReportField.ts.
Use Formula.parse and FORMULA_PART_TYPES.
Detect unsupported report placeholders like {report:i} or invalid subfields.
Run this check before any optimistic update or API call.
Show an error on the form when validation fails.
Use Localize.translate('common.error.invalidValue', …).
Set the error on INPUT_IDS.INITIAL_VALUE with FormActions.setErrors.
Do not add new translation strings.
Export the helper for tests.
Export getUnsupportedReportFormulaParts.
Do not change its logic.
Add unit tests.
Reject {report:i}.
Allow {report:id} and {report:submit:from}.
// In Policy/ReportField.tsexportfunctiongetUnsupportedReportFormulaParts(initialValue?: string): string[]{// existing logic to parse and collect unsupported report parts}
The solution for this issue has been 🚀 deployed to production 🚀 in version 9.3.59-4 and is now subject to a 7-day regression period 📆. Here is the list of pull requests that resolve this issue:
@linhvovan29546 The PR fixing this issue has been merged! The following checklist (instructions) will need to be completed before the issue can be closed. Please copy/paste the BugZero Checklist from here into a new comment on this GH and complete it. If you have the K2 extension, you can simply click: [this button]
[Contributor] The offending PR and associated issue have been commented on, pointing out the bug it caused and why, so the author and reviewers can learn from the mistake.
Link to the comment on the PR: N/A - This was not a regression. The backend already validates unsupported formula tokens, but the FW never had client-side validation for formula report field initial values. This is a missing validation edge case, not a bug introduced by a specific PR.
Link to the comment on the Issue: N/A
[Contributor] If the regression was CRITICAL (e.g. interrupts a core flow) A discussion in #expensify-open-source has been started about whether any other steps should be taken (e.g. updating the PR review checklist) in order to catch this type of bug sooner.
Link to discussion: N/A - Not critical
[Contributor] If it was decided to create a regression test for the bug, please propose the regression test steps using the template below to ensure the same bug will not reach production again.
[BugZero Assignee] Create a GH issue for creating/updating the regression test once above steps have been agreed upon.
Activity
melvin-bot commentedon Jan 19, 2026
Triggered auto assignment to @dylanexpensify (
Bug), see https://stackoverflow.com/c/expensify/questions/14418 for more details. Please add this bug to a GH project, as outlined in the SO.annaweber830 commentedon Jan 19, 2026
Proposal
Please re-state the problem that we are trying to solve in this issue.
User should not be allowed to save an unsupported formula value OR
App should show a clear validation error for {report:i}.
If saved, the formula report field should:
What is the root cause of that problem?
The UI does not validate formula placeholders/tokens in the “Initial value” input. So unsupported tokens like {report:i} get submitted. The backend then normalizes/rejects/ignores unsupported formula parts (e.g., reverting to a supported default like {report:id}), leading to inconsistent UI state (missing field / unexpected value changes) without any user-facing error.
What changes do you think we should make in order to solve the problem?
App/src/pages/workspace/reports/ReportFieldsInitialValuePage.tsx
Lines 63 to 70 in eafbcff
App/src/pages/workspace/reports/CreateReportFieldsPage.tsx
Lines 102 to 104 in eafbcff
We should add this code to WorkspaceReportFieldUtils
And we should add language params:
type UnsupportedFormulaValueErrorParams = {value: string};What alternative solutions did you explore? (Optional)
We add all locales (de, fr, it, ja, nl, pl, pt-BR, zh-hans, es)
abbasifaizan70 commentedon Jan 19, 2026
Proposal
Please re-state the problem that we are trying to solve in this issue.
When creating or editing a formula report field, users can enter unsupported placeholders like
{report:i}without any validation. This causes:{report:id}without warningWhat is the root cause of that problem?
The root cause is missing client-side validation for formula field placeholders. The app doesn't validate whether a formula uses supported placeholders (like
{report:id}) or unsupported ones (like{report:i}) before attempting to save, leading to:What changes do you think we should make in order to solve the problem?
Add client-side validation to check formula placeholders before saving. The solution includes:
1. Formula Validation Function (
App/src/libs/Formula.ts)getSupportedReportFields()function that returns a list of all supported report field placeholders:id,status,expensescount,type,startdate,enddate,total,reimbursable,currency,policyname,workspacename,created,submit,autoreportingvalidateFormula()function that parses the formula and checks if all placeholders are in the supported listisValidboolean andunsupportedPlaceholdersarray2. Edit Page Validation (
App/src/pages/workspace/reports/ReportFieldsInitialValuePage.tsx)validateFormulafrom Formula.tsvalidateFormcallback for FORMULA type fields3. Create Page Validation (
App/src/pages/workspace/reports/CreateReportFieldsPage.tsx)validateFormulafrom Formula.tsvalidateFormcallback when creating new formula fields4. Translation Support (
App/src/languages/params.ts)InvalidFormulaErrorParamstype withplaceholders: stringproperty5. Error Messages (All language files)
invalidFormulaErrortranslation string toen.tsand all other language files (es.ts, pt-BR.ts, de.ts, fr.ts, it.ts, ja.ts, nl.ts, pl.ts, zh-hans.ts){report:id},{report:name},{report:created}InvalidFormulaErrorParamstype in all language filesTest Branch
#79899
Demo
[-]Report - Formula report field initial value {report:i} is not persisted & resets to {report:id}[/-][+][$250] Report - Formula report field initial value {report:i} is not persisted & resets to {report:id}[/+]melvin-bot commentedon Jan 20, 2026
Job added to Upwork: https://www.upwork.com/jobs/~022013597456074804416
melvin-bot commentedon Jan 20, 2026
Triggered auto assignment to Contributor-plus team member for initial proposal review - @dominictb (
External)yatin-italy commentedon Jan 20, 2026
Proposal
Restate the problem this issue is trying to solve.
Formula report fields let unsupported {report:*} placeholders (e.g., {report:i}) be saved; the server normalizes or drops them, so the field disappears from the list and the value reverts without warning on reopen.
What is the root cause of that problem?
Shared policy actions (createReportField/updateReportFieldInitialValue in src/libs/actions/Policy/ReportField.ts) never validate report-formula placeholders—they optimistically persist any string and only infer type from brace presence. Unsupported tokens reach the API, which mutates/drops them, violating the guarantee that persisted initial values use only supported formula tokens.
What changes do you think we should make in order to solve the problem?
Enforce this rule:
“A workspace report field initial value is saved only if all
{report:*}placeholders are supported by the Formula evaluator.”Add validation in
Policy/ReportField.ts.Use
Formula.parseandFORMULA_PART_TYPES.Detect unsupported report placeholders like
{report:i}or invalid subfields.Run this check before any optimistic update or API call.
Show an error on the form when validation fails.
Use
Localize.translate('common.error.invalidValue', …).Set the error on
INPUT_IDS.INITIAL_VALUEwithFormActions.setErrors.Do not add new translation strings.
Export the helper for tests.
Export
getUnsupportedReportFormulaParts.Do not change its logic.
Add unit tests.
Reject
{report:i}.Allow
{report:id}and{report:submit:from}.Exact code deltas (snippets, no filepaths)
What alternative solutions did you explore? (Optional)
N/A
melvin-bot commentedon Jan 24, 2026
@dominictb Uh oh! This issue is overdue by 2 days. Don't forget to update your issues!
60 remaining items
melvin-bot commentedon Apr 16, 2026
Reviewinglabel has been removed, please complete the "BugZero Checklist".melvin-bot commentedon Apr 16, 2026
The solution for this issue has been 🚀 deployed to production 🚀 in version 9.3.59-4 and is now subject to a 7-day regression period 📆. Here is the list of pull requests that resolve this issue:
If no regressions arise, payment will be issued on 2026-04-23. 🎊
For reference, here are some details about the assignees on this issue:
melvin-bot commentedon Apr 16, 2026
@linhvovan29546 The PR fixing this issue has been merged! The following checklist (instructions) will need to be completed before the issue can be closed. Please copy/paste the BugZero Checklist from here into a new comment on this GH and complete it. If you have the K2 extension, you can simply click: [this button]
melvin-bot commentedon Apr 21, 2026
@linhvovan29546 Eep! 4 days overdue now. Issues have feelings too...
melvin-bot commentedon Apr 22, 2026
Triggered auto assignment to @mallenexpensify (
Awaiting Payment)linhvovan29546 commentedon Apr 23, 2026
BugZero Checklist:
[Contributor] The offending PR and associated issue have been commented on, pointing out the bug it caused and why, so the author and reviewers can learn from the mistake.
Link to the comment on the PR: N/A - This was not a regression. The backend already validates unsupported formula tokens, but the FW never had client-side validation for formula report field initial values. This is a missing validation edge case, not a bug introduced by a specific PR.
Link to the comment on the Issue: N/A
[Contributor] If the regression was CRITICAL (e.g. interrupts a core flow) A discussion in #expensify-open-source has been started about whether any other steps should be taken (e.g. updating the PR review checklist) in order to catch this type of bug sooner.
Link to discussion: N/A - Not critical
[Contributor] If it was decided to create a regression test for the bug, please propose the regression test steps using the template below to ensure the same bug will not reach production again.
[BugZero Assignee] Create a GH issue for creating/updating the regression test once above steps have been agreed upon.
Link to issue: https://github.com/Expensify/Expensify/issues/627940
Regression Test Proposal
Precondition:
Test:
{report:i}{report:id}and save{report:unknown}{report:title}) and saveDo we agree 👍 or 👎
Zapier Logs
Run ID: 00040eee-ca59-a16b-0126-699fb97020d4mallenexpensify commentedon Apr 23, 2026
@annaweber830 can you please accept the job below? Please reply here and tag me once you have.
https://www.upwork.com/jobs/~022047381003309283930
@twisterdotcom can you pay @annaweber830 once they've accepted the job? Can you also pay @linhvovan29546 ? Their contract is here. Thx
twisterdotcom commentedon Apr 24, 2026
Payment Summary:
mallenexpensify commentedon Apr 24, 2026
@annaweber830 paid, summary updated above. Thx.