Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

180
Views
Passing 2 fields to key in headers, react-csv

Related to the existing question. How to assign two fields data in header of react-csv. I am working on something and came across the same issue. Asking again since there is no correct answer given. The following code for headers. - key: "user.firstname + user.lastname" doesn't work and the fields are empty. Please help how to get this working! TIA!!

Code:

headers = [
{
  label: "id",
  key: "user.id"
},
{
  label: "Agent Name",
  key: "user.firstName + user.lastName"
},
{
  label: "Agent Email",
  key: "user.email"
},
{
  label: "Agent Phone",
  key: "user.phoneNumber"
},
{
  label: "Agent Commission",
  key: "agentComission"
},
{
  label: "Company Commission",
  key: "companyComission"
},
{
  label: "Total Sale",
  key: "sale"
}
];

Data format example :

data = [
  {
    id: 1,
    firstnamename: "name ",
    lastname: "lastname",
    email: "test@gmail.com",
    phoneNumber: 123456789,
    agentComission: 'agent comission',
    companyComission: 'company comission',
    sale: 'sale',
  },
  {
    id: 2,
    firstnamename: "name",
    lastname: "lastname,
    email: "test2@gmail.com",
    phoneNumber: 123456789,
    agentComission: 'agent comission 2',
    companyComission: 'company comission 2',
    sale: 'sale 2',
  },
];
about 4 years ago · Juan Pablo Isaza
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!