[$175] Transactions from 1 card will not upload while the other cards on the CSV will upload.
If you haven’t already, check out our contributing guidelines for onboarding. To join our Slack channel, fill out this form.
Version Number: v9.5.41-2 Reproducible in staging?: Needs Reproduction (Reproduction blocked) Reproducible in production?: Needs Reproduction If this was caught during regression testing, add the test name, ID and link from BrowserStack: Email or phone of affected tester (no customers): Logs: https://stackoverflow.com/c/expensify/questions/4856 Expensify/Expensify Issue URL: Issue reported by: @AHowell14 Slack conversation (hyperlinked to channel name): #Expensify Bugs
Action Performed:
- Admin creates a spreadsheet of card transactions for 3 different cards and saves as a CSV
- In New Expensify head to Workspaces > Workspace Name > Company Cards
- Select Add Cards
- Select Australia
- Import transactions from file
- Add feed name
- Select file to upload
- Assign cards
Expected Result:
Each of the 3 assigned cards will show transactions
Actual Result:
Only 2 of the 3 are showing transactions. According to my investigation Expensify received the file, but it isn’t recognizing the expenses as belonging to that 1 card.
Workaround:
Unknown
Platforms:
Select the officially supported platforms where the issue was reproduced:
- [ ] Android: App
- [ ] Android: mWeb Chrome
- [ ] iOS: App
- [ ] iOS: mWeb Safari
- [ ] iOS: mWeb Chrome
- [x] Windows: Chrome
- [x] MacOS: Chrome / Safari
Screenshots/Videos
Upwork Automation - Do Not Edit
- Upwork Job URL: https://www.upwork.com/jobs/~022123479752662514698
- Upwork Job ID: 2123479752662514698
- Last Price Increase: 2026-11-19
Issue Owner
Current Issue Owner: @Julesssss
Triggered auto assignment to Contributor-plus team member for initial proposal review - @nyomanjyotisa (External)
Job added to Upwork: https://www.upwork.com/jobs/~022123479752662514698
Issue Analysis
⚠️ Preliminary analysis — low confidence. The reported symptoms are consistent with a card-specific import or visibility problem, but the root cause is not yet verified.
Findings
The issue reports that two cards receive expenses from a shared CSV while the third does not. This does not establish that Expensify failed to recognize the third card.
Code evidence and hypothesis checks
- The upload retains all CSV rows. Local validation skips some rows when calculating transactions, but submits the complete copied CSV. That validation alone does not explain one card disappearing: CompanyCards.ts:153–205, upload payload:1452–1462.
- Assignment is card-specific. Each request sends a selected card identifier, assignee and start date. These should be compared between the failing and working cards: CompanyCards.ts:496–507.
- A default “today” cutoff is not supported by this snapshot. Fresh CSV assignments explicitly use “From the beginning”: useAssignCard.ts:145–157.
These references describe 9.5.42-2, not the reported 9.5.41-2: package.json:1–4.
Evidence needed
Through an authorized private channel, obtain:
- A sanitized CSV preserving card-number formatting, dates and Unique ID relationships, plus selected column mappings.
- Workspace/feed identifiers, the affected card identifier and one working control card.
- Actual upload/assignment timestamps with timezone and requestIDs, if available.
- The third card’s assignee and saved import start date.
Then trace one missing row through card matching → date/deduplication filters → expense creation, and check whether it already exists outside the observed view.
Verification blocker: No reproducible CSV or scoped production identifiers were supplied. No browser reproduction or production-log confirmation was completed. Backend matching/filtering remains unverified; an App-only fix is not justified yet.
Potentially related
Company-card CSV upload reverses UK dates and overstates imported transactions also concerns partial CSV imports, but this issue provides no evidence of the same date or permission failures. It is not a confirmed duplicate.
Next Steps: Obtain the scoped evidence before selecting an implementation plan.
Proposal
Please re-state the problem that we are trying to solve in this issue.
When importing company card transactions from a spreadsheet containing 3 different cards into New Expensify (under Company Cards > Import transactions from file), only 2 of the 3 cards display transactions after assignment, while the transactions belonging to the third card fail to appear.
What is the root cause of that problem?
In src/libs/actions/CompanyCards.ts:
Inside buildOptimisticCompanyCardCSVTransactions():
const cardNumberColumnIndex = getColumnIndex(normalizedColumnMappings, CONST.CSV_IMPORT_COLUMNS.CARD_NUMBER);
const cardNameColumnIndex = getColumnIndex(normalizedColumnMappings, CONST.CSV_IMPORT_COLUMNS.CARD_NAME);
const cardIdentityColumnIndex = cardNumberColumnIndex >= 0 ? cardNumberColumnIndex : cardNameColumnIndex;
cardIdentityColumnIndexresolves mutually exclusively: ifcardNumberColumnIndex >= 0, it exclusively reads fromcardNumberColumnIndex. In CSVs where some transactions have a card number (or last 4 digits) while others have the cardholder name, or where one card uses a distinct column, rows with an empty cell incardNumberColumnIndexare dropped.- In the row validation loop (lines 162–172):
const cardName = cardIdentityColumnIndex >= 0 ? row.at(cardIdentityColumnIndex)?.trim() : undefined;
...
if (!cardName || !created || !currency || amount === undefined) {
continue;
}
row[postedDateColumnIndex] = created;
When a row is skipped via continue, the in-place date normalization row[postedDateColumnIndex] = created is not executed for that row.
Because csvDataWithGeneratedIDs is subsequently serialized and transmitted to the backend in importCSVCompanyCards (parameters.csvData = JSON.stringify(csvDataWithGeneratedIDs)), the backend parser receives raw unnormalized date formats for those rows, causing the backend parser to drop the transactions for that card.
3. Furthermore, in parseCSVAmount:
function parseCSVAmount(value: string): number | undefined {
const sanitized = String(value).replaceAll(/[^\d.-]/g, '');
...
Card exports from certain banks/regions format negative transactions or credits with parentheses (e.g. (150.00)) or accounting symbols that lose their sign or fail to parse if trailing/leading spaces or currency codes are attached without regex stripping.
What changes do you think we should make in order to solve the problem?
- In
src/libs/actions/CompanyCards.ts: InbuildOptimisticCompanyCardCSVTransactions(), support fallback between card number and card name so that if one column cell is blank on a given row, it falls back to the other mapped column:const rawCardNumber = cardNumberColumnIndex >= 0 ? row.at(cardNumberColumnIndex)?.trim() : undefined; const rawCardName = cardNameColumnIndex >= 0 ? row.at(cardNameColumnIndex)?.trim() : undefined; const cardIdentifier = rawCardNumber || rawCardName; - Ensure date normalization (
parseCSVDate) runs on all parsable rows before any validation early-exit, so thatcsvDataWithGeneratedIDspassed to the backend contains consistentyyyy-MM-ddformatted dates across all cards. - Enhance
parseCSVAmountto handle accounting parenthesis notation (e.g.,(100.00)$\rightarrow$-100.00). - In
useAssignCard.ts, ensure that when cards are assigned from a newly imported CSV feed, default import start dates (startDate) match the earliest transaction timestamp in the feed (From the beginning), ensuring transactions are not filtered out by an inadvertent date cutoff.
What alternative solutions did you explore?
Handling column fallback only on the backend, but fixing client-side normalization in buildOptimisticCompanyCardCSVTransactions guarantees that optimistic transactions and the submitted payload (csvDataWithGeneratedIDs) stay perfectly aligned and reproducible.
@AHowell14 Could you share a small sanitized CSV that reproduces this, along with the column mappings?
📣 @AHowell14! 📣 Hey, it seems we don’t have your contributor details yet! You'll only have to do this once, and this is how we'll hire you on Upwork. Please follow these steps:
- Make sure you've read and understood the contributing guidelines.
- Get the email address used to login to your Expensify account. If you don't already have an Expensify account, create one here. If you have multiple accounts (e.g. one for testing), please use your main account email.
- Get the link to your Upwork profile. It's necessary because we only pay via Upwork. You can access it by logging in, and then clicking on your name. It'll look like this. If you don't already have an account, sign up for one here.
- Copy the format below and paste it in a comment on this issue. Replace the placeholder text with your actual details.
Format:
Contributor details
Your Expensify account email: <REPLACE EMAIL HERE>
Upwork Profile Link: <REPLACE LINK HERE>
@AHowell14 Thanks! On staging, none of the three cards showed transactions after assignment. Does this same CSV reproduce the one-card issue for you?
@nyomanjyotisa I reproduced this on staging with the CSV attached above, and it looks like a backend issue rather than an App one. Sharing in case it saves someone time:
- After importing the CSV and assigning all 3 cards, none of them show any transactions (same as your result, not just one card).
ImportCSVCompanyCardssends all 9 rows for the 3 cards with the expected column mapping (cardNumber,postedDate,merchant,amount,currency) and returns200.- Each
AssignCardcall sendsstartDate: ''("From the beginning") and returns200. - The resulting cards have
scrapeMinDate: "",lastScrapeResult: 200andstate: 3, but the feed's search still returns 0 expenses.
One thing that might be relevant: the CSV identifies the cards as XXXXXXXXXXX61020, XXXXXXXXXXX62240 and XXXXXXXXXXX61111, while the cards created by the backend are 000000XXXXXX1020, 000000XXXXXX2240 and 000000XXXXXX1111. Since the App sends the rows unchanged, the matching between CSV rows and the assigned cards seems to happen server-side.
I didn't find anything in the App code path that drops rows or filters by date for CSV feeds, so I don't think there's an App-side fix here.
📣 @Xch4rt! 📣 Hey, it seems we don’t have your contributor details yet! You'll only have to do this once, and this is how we'll hire you on Upwork. Please follow these steps:
- Make sure you've read and understood the contributing guidelines.
- Get the email address used to login to your Expensify account. If you don't already have an Expensify account, create one here. If you have multiple accounts (e.g. one for testing), please use your main account email.
- Get the link to your Upwork profile. It's necessary because we only pay via Upwork. You can access it by logging in, and then clicking on your name. It'll look like this. If you don't already have an account, sign up for one here.
- Copy the format below and paste it in a comment on this issue. Replace the placeholder text with your actual details.
Format:
Contributor details
Your Expensify account email: <REPLACE EMAIL HERE>
Upwork Profile Link: <REPLACE LINK HERE>
Contributor details Your Expensify account email: [email protected] Upwork Profile Link: https://www.upwork.com/freelancers/~011c153b41ed13b922
✅ Contributor details stored successfully. Thank you for contributing to Expensify!
@nyomanjyotisa in my test account I could not get anything to show for any of the 3 cards either.
@nyomanjyotisa Uh oh! This issue is overdue by 2 days. Don't forget to update your issues!
@nyomanjyotisa Eep! 4 days overdue now. Issues have feelings too...
The sample CSV shows no transactions for any of the three cards in both our tests. I think a CME needs to investigate before we select an App fix.
🎀 👀 🎀 C+ reviewed
Triggered auto assignment to @Julesssss, see https://stackoverflow.com/c/expensify/questions/7972 for more details.