Skip to content

[Tracking] Optimistic report title formula computation #59689

Closed
8 of 8 issues completed
Closed

Description

@neil-marcellini

Problem

We have been working on implementing automatic report titles for new Expensify to match the feature on classic. Automatic report titles use a formula defined the policy to compute the report name and the report name is continually updated as data changes. The formulas are made up of various different parts such as {report:type}, report:startdate, etc. You can check out how this feature works by going to Expensify Classic (expensify.com), workspace settings, choosing the report tab on the left side, and scrolling down to the automatic report title section. There is also a help site page linked there with more information. We're also updating the feature so that it sends out real time updates versus requiring a page refresh or loading the report.

In order to maintain our standards of an optimistic offline first application, we will need to implement report formula computation on the front end. When a new report is created, it should optimistically have the automatic report title set based on the formula in the policy settings. Whenever any data is optimistically updated such as the amount of an expense, for example, then the report title should update if it depends on that data. One example would be a formula that references the report total.

We will gradually be rolling out support for more formula parts in new Expensify, and the entire feature will be under a beta flag while development is still active. Please stay in touch with me (@neil-marcellini) for updates on our backend progress.

Solution

Let's design a system to optimistically update the report title based on the formula, and integrate it into the application such that any API request will be automatically handled. It might make a good middleware for example. Once the system is designed, implement it for a few report formula parts that we already support like report type, start date and total. After that, we can distribute the implementation across a large number of contributors to get the remaining parts done faster.

The system should be under a beta to start, and we'll let you know the name of the beta as soon as it is created.

  • Edit: follow the plan in the Offline Support section of the design doc to create the initial structure. If you don't have access to the document, please request access from an internal employee.

Implement the remaining functionality

Basic report fields

Report Dates

  • {report:enddate} – Report end date (newest expense date)

Report Amounts

  • {report:reimbursable} – Total reimbursable amount

Policy / Workspace Info

  • {report:autoreporting:start} – Start date of Auto-reporting frequency info
  • {report:autoreporting:end} – End date of Auto-reporting frequency info

Submission Info

  • {report:submit:from:firstname} – Submitter's first name
  • {report:submit:from:lastname} – Submitter's last name
  • {report:submit:from:fullname} – Submitter's full name
  • {report:submit:from:email} – Submitter's email
  • {report:submit:from:userid} – Submitter's user ID (requires advanced accounting)
  • {report:submit:from:customfield1} – Submitter's custom field 1
  • {report:submit:from:customfield2} – Submitter's custom field 2
  • {report:submit:to:firstname} – Manager's first name
  • {report:submit:to:lastname} – Manager's last name
  • {report:submit:to:fullname} – Manager's full name
  • {report:submit:to:email} – Manager's email
  • {report:submit:to:userid} – Manager's user ID
  • {report:submit:date} – Submission date

Custom Report Fields

  • {field:FIELDNAME} – Any custom report field by name
  • Custom fields support date formatting and other modifiers

Function Modifiers

(Applied with pipe syntax: {formula|function})

  • |frontpart – Front part of email or first word ✅
  • |domain – Domain part of email ✅
  • |substr:start:length – Substring extraction ✅
  • |leftpad:char:length – Left pad with character to length

Currency Formatting Options

(Applied to amount fields)

  • nosymbol – No currency symbol
  • USD, EUR, etc. – Specific currency
Issue OwnerCurrent Issue Owner: @neil-marcellini

Activity

  1. added
    ExternalAdded to denote the issue can be worked on by a contributor
    Help WantedApply this label when an issue is open to proposals by contributors
    on Apr 4, 2025
  2. melvin-bot commented on Apr 4, 2025

    @melvin-bot

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

  3. melvin-bot commented on Apr 4, 2025

    @melvin-bot

    Triggered auto assignment to @bfitzexpensify (NewFeature), see https://stackoverflowteams.com/c/expensify/questions/14418#:~:text=BugZero%20process%20steps%20for%20feature%20requests for more details. Please add this Feature request to a GH project, as outlined in the SO.

  4. sosek108 commented on Apr 22, 2025

    @sosek108
    Contributor

    @neil-marcellini Hi, I'm Hubert from Callstack - expert contributor group - and I would like to take a look at this issue.

  5. 220 remaining items

  6. neil-marcellini commented on Oct 14, 2025

    @neil-marcellini
    ContributorAuthor

    Same, work continues.

  7. neil-marcellini commented on Oct 21, 2025

    @neil-marcellini
    ContributorAuthor

    Moving along well

  8. neil-marcellini commented on Oct 29, 2025

    @neil-marcellini
    ContributorAuthor

    I have been traveling a bit and focused on the last backend blocker, so I haven't given daily updates recently and not sure where this is at. I really hope to check in tomorrow.

  9. neil-marcellini commented on Nov 4, 2025

    @neil-marcellini
    ContributorAuthor
  10. neil-marcellini commented on Nov 11, 2025

    @neil-marcellini
    ContributorAuthor

    Work continues. Polish holidays are causing some delays but that's ok.

  11. neil-marcellini commented on Nov 18, 2025

    @neil-marcellini
    ContributorAuthor

    Still working on the refactor, but it's getting close at least for step one.

  12. neil-marcellini commented on Dec 1, 2025

    @neil-marcellini
    ContributorAuthor

    We had decided here that the ROI for this is too low, and moving forward we're only going to focus on optimistic updates for report creation.

    We can abandon the Onyx derived values refactor, clean up the code, and call it good most likely.

  13. neil-marcellini commented on Dec 9, 2025

    @neil-marcellini
    ContributorAuthor

    Should be done when this is done Optimistically compute report names on creation

  14. neil-marcellini commented on Dec 23, 2025

    @neil-marcellini
    ContributorAuthor

    Not overdue, this is really just a tracking issue

  15. neil-marcellini commented on Dec 30, 2025

    @neil-marcellini
    ContributorAuthor

    I don't think we really need this tracking issue anymore

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Labels

ExternalAdded to denote the issue can be worked on by a contributorNewFeatureSomething to build that is a new item.WeeklyKSv2

Type

No type

Projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions