fix: Report - Formula report field initial value {report:i} is not persisted & resets to {report:id}#84207
fix: Report - Formula report field initial value {report:i} is not persisted & resets to {report:id}#84207annaweber830 wants to merge 1 commit intoExpensify:mainfrom
Conversation
|
Hey, I noticed you changed If you want to automatically generate translations for other locales, an Expensify employee will have to:
Alternatively, if you are an external contributor, you can run the translation script locally with your own OpenAI API key. To learn more, try running: npx ts-node ./scripts/generateTranslations.ts --helpTypically, you'd want to translate only what you changed by running |
|
@linhvovan29546 Please copy/paste the Reviewer Checklist from here into a new comment on this PR and complete it. If you have the K2 extension, you can simply click: [this button] |
Codecov Report✅ Changes either increased or maintained existing code coverage, great job!
|
Reviewer Checklist
Screenshots/VideosAndroid: HybridAppAndroid: mWeb ChromeiOS: HybridAppiOS: mWeb SafariMacOS: Chrome / Safari |
|
@annaweber830 Do you have access to the open-source Slack channel? |
|
Could you please address this comment? |
linhvovan29546
left a comment
There was a problem hiding this comment.
@annaweber830 Could you please merge main and resolve conflict?
| reportFieldNameRequiredError: 'Please enter a report field name', | ||
| reportFieldTypeRequiredError: 'Please choose a report field type', | ||
| circularReferenceError: "This field can't refer to itself. Please update.", | ||
| unsupportedFormulaValueError: ({value}: UnsupportedFormulaValueErrorParams) => `Unsupported formula token(s): ${value}. Use supported tokens such as {report:id}.`, |
|
@codex review |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: d0979fb0b3
ℹ️ About Codex in GitHub
Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".
| const submitField = rest.at(1)?.trim().toLowerCase(); | ||
| if (!submitField || !supportedSubmitPersonFields.has(submitField)) { |
There was a problem hiding this comment.
Permit
{report:submit:from}/{report:submit:to} tokens
This validation now treats report:submit:from and report:submit:to as invalid unless a third segment is present, so formulas using those 2-segment tokens will be blocked with unsupportedFormulaValueError. That conflicts with our documented/embedded formula vocabulary where both tokens are valid (see docs/articles/new-expensify/reports-and-expenses/Customize-and-Enforce-Report-Titles.md lines 62-63 and src/languages/en.ts line 5404), so this introduces a regression by rejecting formulas users are told to use.
Useful? React with 👍 / 👎.
| FORMULA_PART_TYPES: {REPORT: string}; | ||
| }; | ||
|
|
||
| const supportedReportFields = new Set([ |
There was a problem hiding this comment.
Looks like we're missing some accepted formulas. Can you check here and test adding them?

Explanation of Change
fix: Report - Formula report field initial value {report:i} is not persisted & resets to {report:id}
Fixed Issues
$ #79855
PROPOSAL: #79855 (comment)
Tests
Pre-condition: report field is enabled
Offline tests
Same as test
QA Steps
// TODO: These must be filled out, or the issue title must include "[No QA]."
Pre-condition: report field is enabled
PR Author Checklist
### Fixed Issuessection aboveTestssectionOffline stepssectionQA stepssectiontoggleReportand notonIconClick)src/languages/*files and using the translation methodSTYLE.md) were followedAvatar, I verified the components usingAvatarare working as expected)StyleUtils.getBackgroundAndBorderStyle(theme.componentBG))npm run compress-svg)Avataris modified, I verified thatAvataris working as expected in all cases)Designlabel and/or tagged@Expensify/designso the design team can review the changes.ScrollViewcomponent to make it scrollable when more elements are added to the page.mainbranch was merged into this PR after a review, I tested again and verified the outcome was still expected according to theTeststeps.Screenshots/Videos
Android: Native
Android: mWeb Chrome
iOS: Native
iOS: mWeb Safari
MacOS: Chrome / Safari
Screen.Recording.2026-03-04.at.2.50.25.PM.mov