fix: New workflow is not added via Import Spreadsheet in a control WS#82075
Conversation
Codecov Report❌ Looks like you've decreased code coverage for some files. Please write tests to increase, or at least maintain, the existing level of code coverage. See our documentation here for how to interpret this table.
|
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 238178c18d
ℹ️ 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 onyxData = updateImportSpreadsheetData(added, updated); | ||
|
|
||
| const shouldUpdateApprovalMode = members.some((member) => !!member.submitsTo || !!member.forwardsTo) && isControlPolicy(policy); |
There was a problem hiding this comment.
Derive approval mode from the imported workflow shape
When a control workspace imports members whose submitsTo all point at the default approver, this branch still forces approvalMode to ADVANCED just because at least one row has submitsTo. That disagrees with the app's own workflow derivation: convertPolicyEmployeesToApprovalWorkflows() keeps that case as a single default workflow, and WorkspaceWorkflowsPage only treats the workspace as advanced when there are multiple workflows or multiple approvers. As a result, a basic workspace can be promoted to advanced after import, which changes how the workflows UI and approval behavior interpret the policy even though the imported employee list still represents only the default workflow.
Useful? React with 👍 / 👎.
JmillsExpensify
left a comment
There was a problem hiding this comment.
Fix aligns with intended product behavior.
Reviewer Checklist
Screenshots/VideosAndroid: HybridAppCleanShot.2026-03-21.at.15.17.23.6.mp4Android: mWeb ChromeCleanShot.2026-03-21.at.15.14.57.5.mp4iOS: HybridAppCleanShot.2026-03-21.at.15.11.45.mp4iOS: mWeb SafariCleanShot.2026-03-21.at.15.11.45.3.mp4MacOS: Chrome / SafariCleanShot.2026-03-20.at.21.41.10.2.mp4 |
|
@nkdengineer Have you encountered this issue when import on policy control being flaky on the web platform? CleanShot.2026-03-21.at.15.12.52-bug.4.mp4 |
|
@mollfpr Could you please help verify this error message from the backend? It’s flaky to reproduce when importing members into a collection workspace then remove member
bug-import-collection-policy.mp4The current solution updating the approval mode to ADVANCED when importing members—doesn’t work for collection workspaces. @JmillsExpensify Which specific behavior do we need to handle in this case? CleanShot.2026-03-21.at.15.36.36.1.mp4 |
|
@mollfpr @JmillsExpensify Can you please check the comment above? |
It's confirmed we got the approval upgrade |
|
Ok so reviewing where we are at, I think we should not set the |
|
@Expensify/product-pr thoughts on that approach? We should make sure we're aligned on how to handle CSV import upgrade cases in general. |
We’re still waiting for @Expensify/product-pr to confirm whether importing a CSV that includes forwardsTo or submitsTo field should show the upgrade RHP confirmation. |
|
I bumped them |
|
That handle doesn't tag anyone. Use the |
|
Is this accurate on how Classic handles importing a CSV of members and their approval workflow in this regard? Collect workspace
Control workspaces
|
|
@JmillsExpensify, can you please confirm if here is the expected behavior we want. |
|
@JmillsExpensify, please check my comment here. |
|
@trjExpensify From this comment, we still allow setting these fields like Or we will hide these columns like this when importing members on the Collect WS like this? Screen.Recording.2026-05-27.at.10.48.06.movIf option 1 is expected, this is currently a backend issue. Otherwise, we will fix it in FE like the video above. cc @mollfpr |
|
I think what @JmillsExpensify is saying here is that he'd prefer it if we:
A. Role:
@JmillsExpensify is that right? |
|
Yes, that's correct. Thanks for the thorough summary. |
|
@suneox I updated. It's ready for review now. |
@nkdengineer I lost track of this one. Could you please resolve the conflicts? Thank you! |
|
@suneox I updated. |
|
The upgrade policy issue was fixed with this logic Basic policyCleanShot.2026-06-16.at.23.58.33.2.mp4Control policyCleanShot.2026-06-16.at.23.57.08.1.mp4 |
|
✋ This PR was not deployed to staging yet because QA is ongoing. It will be automatically deployed to staging after the next production release. |
|
🚧 @mollfpr has triggered a test Expensify/App build. You can view the workflow run here. |
|
🧪🧪 Use the links below to test this adhoc build on Android, iOS, and Web. Happy testing! 🧪🧪
|
|
🚀 Deployed to staging by https://github.com/mollfpr in version: 9.4.10-0 🚀
Bundle Size Analysis (Sentry): |
Help site review — no changes requiredI reviewed the changes in this PR against the help site articles under Why: This PR is a bug fix that restores intended behavior for the existing spreadsheet member-import flow. It does two things, neither of which introduces a new user-facing feature, label, tab, or flow that the help site documents:
The import UI itself is unchanged — the Submit to, Approve to, Approval limit, etc. column mappings already existed before this PR; only the resulting behavior was fixed. The relevant article, Managing Workspace Members, documents the Invite Multiple Members via Spreadsheet flow at a high level (steps + template link) and intentionally does not cover the individual column mappings or plan-gating. Since this PR adds no new documented concept, there's nothing to update. Because no changes are required, I did not create a draft help site PR. @nkdengineer, please confirm you agree no help site update is needed. If you'd prefer the spreadsheet-import section be expanded to document the approval-workflow columns and the Control-plan requirement, reply with |
|
🚀 Deployed to staging by https://github.com/mollfpr in version: 9.4.12-0 🚀
Bundle Size Analysis (Sentry): |
|
🤖 No help site changes required. I reviewed the changes in this PR against the help articles under What this PR does: It's a bug fix so that importing members via Import via Spreadsheet into a Control workspace correctly creates the approval workflow — by switching the workspace's approval mode to advanced when the uploaded file includes approval/workflow columns (e.g. Why no docs update is needed: The only help article that covers this flow is Managing-Workspace-Members.md → Invite Multiple Members via Spreadsheet. It documents the high-level steps (Members → three-dot menu → Import via Spreadsheet → upload) and links to the formatting template, but it does not document the individual spreadsheet columns or the resulting approval-workflow behavior. This PR restores intended behavior without changing any documented step or user-facing flow, so there's nothing in the help site that becomes inaccurate or needs new content. Since no help article describes the workflow/approval-column behavior, no draft docs PR was created. If you'd like the spreadsheet import column behavior documented as a new enhancement (e.g. explaining the |
|
🚀 Deployed to staging by https://github.com/mollfpr in version: 9.4.14-0 🚀
Bundle Size Analysis (Sentry): |
|
🤖 Update — docs changes are warranted, draft PR created. On a closer look, this PR makes the spreadsheet member-import approval fields functional in a Control workspace, and that behavior is currently undocumented. I drafted a help-site update for it: Draft docs PR: #93902 It updates the Invite Multiple Members via Spreadsheet section of
I applied the @nkdengineer, please review the linked help site PR and confirm it reflects the current behavior. Then mark the linked help site PR |
|
🚀 Deployed to production by https://github.com/puneetlath in version: 9.4.14-1 🚀
|
Explanation of Change
fix: New workflow is not added via Import Spreadsheet in a control WS
Fixed Issues
$ #80428
PROPOSAL: #80428 (comment)
Tests
Offline tests
None
QA Steps
Same as test
PR Author Checklist
### Fixed Issuessection aboveTestssectionOffline stepssectionQA stepssectioncanBeMissingparam foruseOnyxtoggleReportand 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
Screen.Recording.2026-03-18.at.14.18.42.mov
Android: mWeb Chrome
Screen.Recording.2026-03-18.at.14.20.01.mov
iOS: Native
Screen.Recording.2026-03-18.at.14.22.20.mov
iOS: mWeb Safari
Screen.Recording.2026-03-18.at.14.16.00.mov
MacOS: Chrome / Safari
Screen.Recording.2026-03-18.at.14.12.19.mov